471,337 Members | 924 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

DOM access to <OBJECT type="text/html" data="..." /> or <iframe>

1
Hello,

I use an object element to replace the iframe element in ie, like this:

[HTML]<object
id="x_obj"
data="http://.../"
type="text/html">

<iframe name="x_if" id="x_if" src="http://.../">
</iframe>

Alternative text (if object and/or iframe are not supported)

</object>
[/HTML]
With an <iframe> to support gecko browsers.

I want to retrieve the total height of the page loaded inside the object/iframe element.

With ie, this script works:

alert(document.getElementById("x_obj").object.body .scrollHeight);


And in gecko browsers (FF), the script should look like this:

alert(document.getElementById("x_if").contentDocum ent.height);


This script written for firefox doesn't work well as it gives a result of "0".

When I delete the object element from my script and just leave the iframe element, it works well.

Could anyone help me understand this strange behaviour ?

Thank you very much.
Jun 29 '06 #1
1 6006
acoder
16,027 Expert Mod 8TB
The iframe should not appear inside object tags. Gecko browsers do support the object tag.
Apr 28 '08 #2

Post your reply

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

Similar topics

9 posts views Thread by Arash Dejkam | last post: by

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.