iframe height is giving wrong value

Posted by user1668527 on Stack Overflow See other posts from Stack Overflow or by user1668527
Published on 2012-10-25T10:58:11Z Indexed on 2012/10/25 11:00 UTC
Read the original article Hit count: 116

I have HTML page which contains line:

<iframe id="xyz" width="900" height="250" scrolling="no"..></iframe>

From my firefox extension i'm trying to get the iframe height.

so i'm registering the browser to a event as follow in my extension:

appcontent.addEventListener("DOMContentLoaded",myfunction);

where appcontent is browser object,

myfunction(event): function
{
 var framelist =window.content.document.getElementsByTagName("iframe");
 for(var i=0;i<framelist.length;i++)
 {
  if(framelist[i].id == "xyz")
  var frameheight=framelist[i].height;
 }
}

when i tried to load this page intially frameheight gives 250 as per in html page but then it gives 0 as height.

What would be the cause for this behaviour. is any other script changing the value of iframe height in between ?

Help me

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about iframe