html页面中iframe导致JavaScript失效


<body onload=“reset()”
>   <div id="part1"> some thing here ....   <div>   <ifame src="xxxx"/>   <script>   function reset(){   var height = window.innerHeight; document.getElementById("part1").style.minHeight = height+"px";     }   </script> </body>

在一个html页面中,通过iframe包含另一个页面的时候,导致onload=“reset()”失效

解决:把<iframe>移到script后面,原因未明


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM