
正文
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后面,原因未明







