码迷,mamicode.com
首页 > 编程语言 > 详细

html页面中iframe导致JavaScript失效

时间:2017-01-23 15:03:15      阅读:191      评论:0      收藏:0      [点我收藏+]

标签:document   原因   htm   span   包含   html   code   function   blog   

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

html页面中iframe导致JavaScript失效

标签:document   原因   htm   span   包含   html   code   function   blog   

原文地址:http://www.cnblogs.com/dannyyao/p/6343909.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!