js/jquery关闭当前窗口

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qqq327954699/article/details/86627002
closeWindow: function() {
    var userAgent = navigator.userAgent;
    if (userAgent.indexOf("Firefox") != -1 || userAgent.indexOf("Chrome") != -1) {
        location.href = "about:blank";
    } else {
        window.opener = null;
        window.open('', '_self');
    }
    window.close();
}

猜你喜欢

转载自blog.csdn.net/qqq327954699/article/details/86627002
今日推荐