Salve a tutti, e buonagiornata. Oggi ho un problema con l'accesso al document di un Iframe. Su FF gira benissimo, su ie no comunque vado ad esplicare il codice spero qualcuno possa aiutarmi. Già quando vado a leggere l'altezza del body del mio IFRAME me ne da una imprecisa ma quando vado a a precisare l'evento onclick sul document dell'Iframe non succede nulla. Ecco il codice:
codice:
<iframe id="iframe1" src="mioURL" scrolling="no" marginwidth="0" marginheight="0" frameborder="0">Il tuo browser non supporta questa applicazione</iframe>
<script type="text/javascript">
this.iframe1 = document.getElementById("iframe1");
this.watchH;
iframe1.onload = function(){
var iframe1C = iframe1.document || iframe1.contentDocument;
var iframeH = iframe1C.body.offsetHeight;
iframe1.style.height = iframeH+"px";
iframe1.style.width = "100%";
watchH = iframe1C.body.offsetHeight;
iframe1C.onclick = function(){
if(iframe1C.body.offsetHeight != watchH){
iframeH = iframe1C.body.offsetHeight;
iframe1.style.height = iframeH+"px";
}
}
}
</script>