Home >Web Front-end >HTML Tutorial >解决iframe无限嵌套问题。_html/css_WEB-ITnose

解决iframe无限嵌套问题。_html/css_WEB-ITnose

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-21 08:59:001348browse

在被iframe嵌套的页面里跳转到登录页,登录后会把整个页面再次嵌套在该iframe内,这样一直登录就会一层一层的嵌套,

解决办法:

    if(self != top) {        top.location.href = window.location.href;    }

相关概念:self是当前窗口,top是最顶层窗口,parent是父窗口。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn