473,657 Members | 2,801 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

2 New Member
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.create Element("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
2 2517
deuce789
31 New Member
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.create Element("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
goodevilgenius
2 New Member
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

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

Similar topics

1
3171
by: putty | last post by:
I found a few posts of people asking about insertCell()/insertRow() not working in IE6 SP2, and a few others about getting "null is null or not an object" errors, but no one posted a solution anywhere or noted this tiny yet curious change in SP2.. so here it is: In IE6 SP2 rows must be inserted into a tBody instead of a Table directly, after that you may insert TDs into TRs any way you wish. insertRow() and insertCell() work the same as...
4
62207
by: millw0rm | last post by:
Hi wats wrng with this code??? it works fine on IE6 but not on FireFox 1.5??? var anOption = document.createElement("OPTION"); document.getElementById("category").options.add(anOption); anOption.innerText = "NewElement"; anOption.Value = "99";
7
8004
by: christian | last post by:
hi there! i've the following piece of html: <div id="tbl"></div> and i'm trying to create an object with the following javascript code: var objDiv = document.getElementById("tbl"); var obj = document.createElement("object");
7
11108
by: laredotornado | last post by:
Hi, Using advice from this newsgroup, I tried this JS to create new DOM elements on-the-fly var divSidebarItem = document.createElement("div"); divSideBarItem.setAttribute("class", "sidebarToDo");
10
13300
RMWChaos
by: RMWChaos | last post by:
WinVista/IE7 I am getting some weird errors only in IE7, but not in FF2.0.0.8 or NN9. It even happens on this website when I click "Sign In". The error is: "A Runtime Error has occurred." "Line:xxx" "Error: Object expected" and Debug says: "Microsoft JScript runtime error: Object expected."
4
23889
by: tswaters | last post by:
Alright, so generally I'm using document.createElement("IMG").... but, I've noticed something just recently that made me switch to "new Image()" What I'm doing is creating a photo gallery of sorts, where i basically want to supply a total # of images, rows/cols max thumb/full image and let the script do the work. The solution I've opted for is to load the images once and change their size / position / visibility to show "thumb galleries" or...
7
1831
by: r_ahimsa_m | last post by:
Hello, I am learning JavaScript. I have a table on HTML page:                 <table id="announcement_fields" border="0">                 <tbody>                 <tr>                 <td><span class="obligatory">Offer type</span>:</td>                 <td>                         <select name="offer_type" onchange="ShowAnnouncementRows();">
6
4952
by: cleary1981 | last post by:
I have adapted code from http://dunnbypaul.net/js_mouse/ I want to use a button to create new draggable divs but i keep getting error "is null or not an object" heres the code <html> <head> <title>Drag and drop module</title> <style type="text/css"> #canvas {
0
8384
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8820
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8499
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7314
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5630
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1937
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1601
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.