一个疑问,需要高手帮忙解答,谢谢!

志明与数据 2009-06-17 11:24:21
<iframe id="show" height="500" width="600" src=""></iframe>
<script type="text/javascript">
var show = document.getElementById('show');
setInterval("show.src='http://student.csdn.net/space.php'",10000);
</script>


为什么iframe中显示出来的页面,以转到该地址就跳出iframe,跳到主页面。
为什么试试其他网址就不会跳出,而直接显示在iframe中,10秒刷新一次~
...全文
30 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
caiying2009 2009-06-20
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 laizhiming1989 的回复:]
明白了,意思就是那个页面设置了,为的就是防止恶意攻击?
[/Quote]
为的就是防止iframe^_^
志明与数据 2009-06-18
  • 打赏
  • 举报
回复
明白了,意思就是那个页面设置了,为的就是防止恶意攻击?
caiying2009 2009-06-18
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 laizhiming1989 的回复:]
如果要改,怎么改呢,完整代码是,谢谢了。
[/Quote]
你如果能修改:http://student.csdn.net/space.php
把:
//iframe包含
if (top.location != location) {
top.location.href = location.href;
}
去掉就好了^_^
志明与数据 2009-06-18
  • 打赏
  • 举报
回复
如果要改,怎么改呢,完整代码是,谢谢了。
caiying2009 2009-06-18
  • 打赏
  • 举报
回复
[script_common.js]

//iframe包含
if (top.location != location) {
top.location.href = location.href;
}

87,910

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧