473,503 Members | 1,652 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

createElement("object") and Problems in IE / FF

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");

obj.data = "text.php";
obj.type = "text/html";
obj.id = "obj_results";
obj.width ="500px";
obj.height="300px";
objDiv.appendChild(obj);

this all seems to work fine in firefox, but wont in ie. firefox also
doesn't care about if I create an embed or an param element, the object
is loaded as wanted. is there any solution for my problem?

cheers, christian

Sep 14 '06 #1
7 7998
VK

ch*******@mazedlx.net wrote:
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");

obj.data = "text.php";
obj.type = "text/html";
obj.id = "obj_results";
obj.width ="500px";
obj.height="300px";
objDiv.appendChild(obj);

this all seems to work fine in firefox
Does it still?? I have to check it and report to Bugzilla if indeed.
but wont in ie. firefox also
doesn't care about if I create an embed or an param element, the object
is loaded as wanted. is there any solution for my problem?
Cross-domain security overpass using embedded objects was a big issue a
couple of years ago. I can't believe it is still in effect by now: a
full check is needed.
Thanks for a hint!

Sep 14 '06 #2
VK wrote:
ch*******@mazedlx.net wrote:
<snip>
> var obj = document.createElement("object");

obj.data = "text.php";
<snip>
> objDiv.appendChild(obj);

this all seems to work fine in firefox

Does it still?? I have to check it and report to Bugzilla if indeed.
You have never made it clear what definition you use for "bug", but
clearly it is very different from anything used in programming.
but wont in ie. firefox also
doesn't care about if I create an embed or an param element, the object
is loaded as wanted. is there any solution for my problem?

Cross-domain security overpass
"Security overpass"?
using embedded objects was a big issue a
couple of years ago. I can't believe it is still in effect by now:
What is cross-domain about loading the relative URL "text.php"?
a full check is needed.
LOL.
Thanks for a hint!
?

Richard.

Sep 14 '06 #3
VK
Richard Cornford wrote:
You have never made it clear what definition you use for "bug", but
clearly it is very different from anything used in programming.
security overpass"?
LOL.
First of all, I di use the word "bug". That is an "unexpected feature
use" if musted to be classified. Secondly, you, guys, like from a time
warp. A 1/3rd (at least) of the world suffered of a virtual browser
initialized over <objecttag, but clj has no information about it.

Sorry to be nasty - but speechless...

Sep 14 '06 #4
thx guys for the relpies, but none of those help me to solve my problem
to get the object to work in IE...

Sep 14 '06 #5


ch*******@mazedlx.net wrote:

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");
With IE you might have more success with e.g.
if (typeof objDiv.insertAdjacentHTML != 'undefined') {
objDiv.insertAdjacentHTML('beforeEnd', [
'<object id="obj_results" data="text.php"',
' type="text/html"',
' width="500" height="300"',
'<\/object>'
].join('\r\n'));
}
of course if you need any param elements then insert them first in the
string you build and then call insertAdjacentHTML on the complete string.
On the other hand I don't see any reason to use an object element to
render a text/html document, using an iframe seems sufficient.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Sep 14 '06 #6
thx martin for the fast and superb solution!

Martin Honnen schrieb:
ch*******@mazedlx.net wrote:

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");

With IE you might have more success with e.g.
if (typeof objDiv.insertAdjacentHTML != 'undefined') {
objDiv.insertAdjacentHTML('beforeEnd', [
'<object id="obj_results" data="text.php"',
' type="text/html"',
' width="500" height="300"',
'<\/object>'
].join('\r\n'));
}
of course if you need any param elements then insert them first in the
string you build and then call insertAdjacentHTML on the complete string.
On the other hand I don't see any reason to use an object element to
render a text/html document, using an iframe seems sufficient.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Sep 14 '06 #7
VK wrote:
Richard Cornford wrote:
>You have never made it clear what definition you use for "bug", but
clearly it is very different from anything used in programming.
security overpass"?
LOL.

First of all, I di use the word "bug".
?
That is an "unexpected feature use"
A bug is an "unexpected feature use"?
if musted to be classified.
What are you going on about?
Secondly, you, guys, like from a time warp. A 1/3rd (at
least) of the world suffered of a virtual browser
initialized over <objecttag,
And that is relevant because?
but clj has no information about it.

Sorry to be nasty - but speechless...
You are not being nasty, you are making a fool of yourself.

Richard.

Sep 14 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3155
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...
4
62196
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);...
7
11095
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",...
2
2512
by: goodevilgenius | last post by:
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...
10
13282
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."...
4
23828
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...
7
1820
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>...
6
4938
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>...
0
7319
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6979
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...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5570
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,...
1
4998
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4666
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...
0
3160
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...
0
3149
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1498
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.