By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,045 Members | 1,339 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,045 IT Pros & Developers. It's quick & easy.

createElement("object") doesn't work in Firefox

P: 2
I have a script that should insert a youtube video into the page. But when I ran it, the video wouldn't show up. (The script inserts a number of things, and the video was the only thing not to appear) So, I open firebug, and check the DOM. It's not in there.
So, I type in "var node = document.createElement("object");" to see what was going on. It then reports node as a function, but it still has all the DOM methods and properties (appendChild, firstChild, etc. still there.) I then, go ahead and create the node in Firebug, and insert it into the DOM. This time, it shows up in the DOM in Firebug, but still doesn't appear on the page.
I tested it in Opera, and it worked as expected.
Oct 7 '07 #1
Share this Question
Share on Google+
2 Replies


P: 31
I have a script that should insert a youtube video into the page. But when I ran it, the video wouldn't show up. (The script inserts a number of things, and the video was the only thing not to appear) So, I open firebug, and check the DOM. It's not in there.
So, I type in "var node = document.createElement("object");" to see what was going on. It then reports node as a function, but it still has all the DOM methods and properties (appendChild, firstChild, etc. still there.) I then, go ahead and create the node in Firebug, and insert it into the DOM. This time, it shows up in the DOM in Firebug, but still doesn't appear on the page.
I tested it in Opera, and it worked as expected.
without code its hard to say, but sounds like it isnt happening because of security permissions in these browsers (cross domain exploits is why this is usually not allowed)
Oct 8 '07 #2

P: 2
In case anyone else has this problem, I figured it out.
I was appending the <object> to a node that was not already in the DOM. I simply rewrote my script to create and append the children after the parent node had already been inserted.
Oct 16 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.