读书人

ifreme 为什么执行的 结果 跳转 出来

发布时间: 2012-02-21 16:26:23 作者: rapoo

ifreme 为什么执行的 结果 跳转 出来 而 不是在 1024*800的框架内
<script>
window.onload = function(){
if(top!=self) top.location.href = self.location.href;
}
</script>
<iframe src="http://www.xici.net/b2488/board.asp" width="1024" height="800"> </iframe>

为什么执行的 结果 跳转 出来 而 不是在 1024*800的框架内

[解决办法]
iframe里不要写 <script>
window.onload = function(){
if(top!=self) top.location.href = self.location.href;
}
</script>

读书人网 >JavaScript

热点推荐