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

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

P: n/a
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
Share this Question
Share on Google+
7 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a


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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.