I'm trying to resize an iframe. My code is working in Chrome and Interner Explorer, but not in Firefox. Can someone explain why.
Here's my javascript:
<script type="text/javascript" language="javascript">
function autoResize(id){
var newheight;
if(document.getElementById){
newheight=document.getElementById(id).contentDocument .body.scrollHeight;
}
document.getElementById(id).height= newheight;
}
</script>
And here is my iframe:
<iframe id="myframe" src="http://www.somesite.com/content/index.php" frameborder="0" scrolling="no" width="900px" onLoad="autoResize('myframe');"></iframe>