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