JavaScript无提示关闭窗口(兼容IE/Firefox/Chrome)

function closeCurrWindow(){
    var browserName=navigator.appName;
    alert(browserName);
    if (browserName=="Netscape") {
        window.open('','_self','');
        window.close(); 
    } else if (browserName=="Microsoft Internet Explorer") {
                window.opener = "whoCares";
                window.opener = null;    //Close window, not hint. for IE6, IE7
                window.open('','_top'); //Close window, not hint. for IE7
                window.close();
            }
}

 

posted @ 2013-05-18 14:10  摩根船长  阅读(407)  评论(0编辑  收藏  举报