i looked for a javascript script that will change the height of an iframe, according to the loaded page in it, i found a code but it works for me only in IE and FireFox.. what should i change?
<SCRIPT type="text/javascript" LANGUAGE="javascript">
function reSize()
{
try{
var oBody = ifrm.document.body;
var oFrame = document.getElementById("ifrm");
oFrame.style.height = oBody.scrollHeight + (oBody.offsetHeight - oBody.clientHeight);
}
//An error is raised if the IFrame domain != its container's domain
catch(e)
{
window.status = 'Error: ' + e.number + '; ' + e.description;
}
}
</SCRIPT>
the iframe code:
<iframe width=940px onload=reSize() src="html/guides.html" id="ifrm" name="iframe_main" frameborder="0"></iframe>
thanks for helping!