Ok, here is my script that works just fine in IE. Onload I want the iframe to resize to the content loaded within it:
Okay, works great in IE but when I try to do in Firefox, I get an error and the iframe does not resize:Code:function calcHeight() { document.getElementById('loadapi').style.display = ""; //find the height of the internal page var the_height=document.getElementById('loadapi').contentWindow.document.body.scrollHeight; //change the height of the iframe document.getElementById('loadapi').height=the_height; } //and the form in page <iframe width="700" id="loadapi" onload="calcHeight();" style="display:none;" scrolling="no" frameborder="0" height="500" name="loadapi"></iframe>
Error: document.getElementById("loadapi").contentWindow.document.body is undefined
What gives?
Thanks
Ryan





Bookmarks