`

window.close()无提示框和在FF无效

    博客分类:
  • js
 
阅读更多

一 IE关闭无提示

window.opener=null;      

window.open('', '_self', '');      

 window.close();

二 在火狐上当前页面打开新的页面

if (navigator.userAgent.indexOf("MSIE") > 0) { 
            if (navigator.userAgent.indexOf("MSIE 6.0") > 0) { 
                window.opener = null;

                window.close(); 
            } 
            else { 
                window.open('', '_top'); window.top.close(); 
            } 
        }else if (navigator.userAgent.indexOf("Firefox") > 0) { 
            window.location.href = 'about:blank ';           
        } else { 
            window.opener = null;  
            window.open('', '_self', ''); 
            window.close(); 
        } 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics