(1)session过期后登陆页面跳出iframe页面问题
登陆页面增加javascript:
function window.onload(){
if(window.parent.length>0)
window.parent.location=location;
}
或者:
if (window != top){
top.location.href = location.href;
}
(2)自动跳出iframe的代码
<script type="text/javascript">
if (top.location !== self.location) {
top.location=self.location;
}
</script>
(3)在框架页内的退出操作:
<script type="text/javascript">
if (top.location !== self.location) {
top.location = "../index.jsp";//跳出框架,并回到首页
}
</script>
js跳出iframe
最新推荐文章于 2022-05-28 20:19:51 发布