<html>
<head>
</head>
<body>
<script type="text/javascript">
if (window.top!=window.self){
window.top.location="index.htm";
}
</script>
</body>
</html>在frameset的页面中登出,往往会被frame在框架内,那么重定向到这个页面就可以了。
如果是直接登出,herf中有个属性叫做target="_top"
本文介绍了在使用frameset布局的网页中实现登出功能的方法,通过JavaScript判断当前窗口是否为顶级窗口并进行重定向,同时提供了直接登出时设置href属性target='_top'的建议。
<html>
<head>
</head>
<body>
<script type="text/javascript">
if (window.top!=window.self){
window.top.location="index.htm";
}
</script>
</body>
</html>
748
1698
1万+

被折叠的 条评论
为什么被折叠?