Home  >  Article  >  Web Front-end  >  html判断当前页面是否在iframe中_html/css_WEB-ITnose

html判断当前页面是否在iframe中_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:35:091444browse


在做HTML页面的时候,经常会遇到“如果当前页面显示在iframe中,我们就相应的处理”

判断方法为:

		//判断是否在iframe中		if(self!=top){			parent.window.location.replace(window.location.href);		}






版权声明:本文为博主原创文章,未经博主允许不得转载。

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