Hi,
I would like to develop the iframe which contains the dynamic width and height and contains no scrollbars.
[QUOTE]
<script language=”JavaScript”>
function calcHeight(id)
{
//find the height of the internal page
var the_height=document.getElementById(id).contentWindow.document.body.scrollHeight;
document.getElementById(‘tframe’).height = (the_height) + “px”;
//find the Width of the internal page
var the_width=document.getElementById(id).contentWindow.document.documentElement.scrollWidth;
document.getElementById(‘the_width’).width = (the_width) + “px”;
}
</script>
<div id=”question”>
<iframe align=”center” title=”View” frameborder=”0″ id=”tframe” marginheight=”0″ marginwidth=”0″ name=”tframe” scrolling=”no” src=”sample.html” onload=”calcHeight(‘tframe’);”></iframe>
</div>
The above coding working well in Firefox but in IE is not working.
The width property “document.documentElement.scrollWidth” is not supported in IE.
I tried by using document.body.scrollWidth , it is not supported both in IE as well as Firefox.
kindly help me to fix this issue
by
raveendran