Home  >  Article  >  Web Front-end  >  javascript 关闭IE6、IE7_javascript技巧

javascript 关闭IE6、IE7_javascript技巧

WBOY
WBOYOriginal
2016-05-16 18:52:09948browse

请各位参看下面的代码。

复制代码 代码如下:

if(ieVersion == "6.0")
{
window.opener=null;
window.close();
}
else if(ieVersion == "7.0")
{
window.open('','_parent','');
window.close();
}

这里需要注意的是在IE7下如果想关闭整个浏览器的话,window.open('','_parent',''); 中的第2个参数应该修改为'_self','_parent'关闭的是单个tab页面。
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