In una pagina html ho inserito uno script che dovrebbe adattarsi in altezza ai differenti contenuti linkati. Purtroppo non funziona e non capisco dove sbaglio...
codice:
<script language="JavaScript">
<!--
function autoResize(external-frame){
var newheight;
var newwidth;
if(document.getElementById){
newheight=document.getElementById(external-frame).contentWindow.document .body.scrollHeight;
newwidth=document.getElementById(external-frame).contentWindow.document .body.scrollWidth;
}
document.getElementById(external-frame).height= (newheight) + "px";
document.getElementById(external-frame).width= (newwidth) + "px";
}
//-->
</script>
e l'iframe settato come segue:
codice:
<div id="Layer3">
<iframe src="index.php" scrolling="no" width="100%" height="100%" name="external-frame" id="external-frame" marginheight="0" frameborder="0" onLoad="autoResize('external-frame');"></iframe>
</div>