关闭框架页,如何在框架页面中关闭页面

类别:网站制作 点击:0 评论:0 推荐:
前些天,我在做个网站,里面有几个框架页面,可是不能使用
“window.opener=false;
window.close()     关闭框架页!  ”

第一种方法:if(window!=window.top){top.location.href=location.href;}
window.close(); 或者window.top.close();   关闭 

第二种方法:调用函数解决:

<script language="JavaScript" type="text/JavaScript">
function turn()
{
window.open("http://www.sohu.com");
}
</script>
<frameset rows="*,154" cols="*" framespacing="2" frameborder="2" onUnload="turn()">
<frame src="t.asp" scrolling="auto" noresize>
<frame src="b.asp" scrolling="auto" noresize>
<noframes>
<body>
</body>
</noframes>
</frameset>

本文地址:http://com.8s8s.com/it/it30841.htm