473,386 Members | 1,652 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 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 6148
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

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

Similar topics

9
by: Arash Dejkam | last post by:
Hi All, Is it possible to write on an <OBJECT type="text/html"> using document.write() from within the html containing that tag the way we write on a popup window? I couldn't do that after a lot...
6
by: Jon Davis | last post by:
I recently learned how to do an <OBJECT> alternative to <IFRAME> in current browsers using: <object id="extendedhtml" type="text/html" data="otherpage.html" width="250" height="400"></object> ...
3
by: Jaime Stuardo | last post by:
Hi all... Both controls are server side. The former has more properties. Both may have associated events that are ran at server. Which one are recommended to use? is performance an issue? in...
13
by: chippy | last post by:
im currently doing my myspace ... ive seen bands put codes in scroll boxes ive tried this but it just showed the code how can i make it show the code not the image???
1
Fary4u
by: Fary4u | last post by:
Hi Guys i'm trying to upload a file, i've tried 3 different methods but still not work out i don't know how to over come this problem hidden file value, multiple form or popup uploading. 1-...
0
Fary4u
by: Fary4u | last post by:
Hi Guys i'm trying to upload a file, i've tried 3 different methods but still not work out i don't know how to over come this problem hidden file value, multiple form or popup uploading. 1-...
17
by: malathib | last post by:
Hi, I have used a rich text editor in my application. I got it from one of the site.all are JS files. My problem is, i want to call a javascript function from the iframe. Can anybody help...
5
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.