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();
            }
}

 

你可能感兴趣的:(JavaScript无提示关闭窗口(兼容IE/Firefox/Chrome))