wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes not able to get width and height of another html file inside html Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "not able to get width and height of another html file inside html " Watch "not able to get width and height of another html file inside html " New topic
Author

not able to get width and height of another html file inside html

Priya Sri
Ranch Hand

Joined: Mar 30, 2004
Posts: 84
Hi all,

I am not able to access iframe id in javascript function. This iframe present inside a div tag. It is giving error in the red part highlighted in my code below.
Please post your ideas on this.



CODE -->
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
When posting please use code tags so it is readable. I did it for you, you need to do it in the future.

You have an id, so use document.getElementById to reference it, you do not need to use the frames array which uses a name, not an id.

Eric
Priya Sri
Ranch Hand

Joined: Mar 30, 2004
Posts: 84
Hi

the problem is i need to get height and width of a html file inside current html file I changed the code like this. Its giving me the height and width of the current html page. But i need the details of html file present in iframe tag which is inside a div tag.

If i use document.frames instead of document.getElementbyId , it gives me the correct height and width of the html file inside iframe.
That also works if iframe is outside not inside div.


 
jQuery in Action, 2nd edition
 
subject: not able to get width and height of another html file inside html
 
Similar Threads
Iframe with Mozilla
Is it possible to write javascript to display files in textarea?
DOJO Charts 2D : Unable to Stretchable / Scrollable/Draggable as in case of Google Maps View.
how to append variable in JSP link
NETSCAPE 6.2 & FRAMES