It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

IFRAME strange at all

IFRAME strange at all

Postby ferroariel on Wed Sep 22, 2010 12:38 pm

I've got an IFRAME
it loads a page with variable contents
I need to know the WIDTH of the body of that page
I'm using offsetWidth and offsetHeight

Code: Select all
var BODYWIDTH = 0
var dyniframe = document.getElementById("Nvg")
if (dyniframe && !window.opera) {
if (dyniframe.contentDocument && dyniframe.contentDocument.body.offsetHeight) //ns6 syntax
BODYWIDTH = dyniframe.contentDocument.body.offsetHeight; //+ FFextraHeight;
else if (dyniframe.Document && dyniframe.Document.body.scrollHeight) //ie5+ syntax
BODYWIDTH = dyniframe.Document.body.scrollHeight;
}
alert("The WIDTH of the body of the page inside the iframe is "+ BODYWIDTH)


This is weird....

offsetHeight returns the height of the document body
offsetWidth returns the width of the iframe !!!!!!! (??????????)

Please, what am i doin wrong??
ferroariel
 
Posts: 1
Joined: Wed Sep 22, 2010 12:14 pm

Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests