怎样不弹出确认框,就直接关闭IE窗口?

GG百度后看到很多网站上写

Code

测试后还是不行,我的浏览器是IE 8.0

一般来说,如果这个窗口是你用window.open()打开的话,  
  你再用window.close()关闭就不会出现对话框了。

但是很多情况下我们不是用window.open打开的,可以用以下 的代码解决

方法1:

Code

方法2:

在a页面上加上一个空白的iframe

Code

在b页面上(b.htm)加上

Code

以下方法大家自己去测试吧====================================================================

方法一:

js 代码
 
Code
方法二:
open.html
js 代码

 

Code

 

close.html
js 代码

 

Code

 

另附:
//普通带提示关闭
function closeie(){
window.close();
}
//关闭IE6不提示
function closeie6(){
window.opener=null;
window.close();
}
//关闭IE7不提示
function closeie7(){
window.open('','_top');
window.top.close();
}
原文地址:https://www.cnblogs.com/smallmuda/p/1399304.html