javascript 检查打开的窗口是否关闭

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javascript 检查打开的窗口是否关闭相关的知识,希望对你有一定的参考价值。

function openKayangWindow(redirectUrl) {
    var width = screen.availWidth - 10;
    var height = screen.availHeight - 50;
    var szFeatures = "top=0,";
    szFeatures += "left=0,";
    szFeatures += "width=" + width + ",";
    szFeatures += "height=" + height + ",";
    szFeatures += "directories=no,";
    szFeatures += "status=yes,toolbar=no,location=no,";
    szFeatures += "menubar=no,";
    szFeatures += "scrollbars=yes,";
    szFeatures += "resizable=yes";
    //window.open(redirectUrl,"",szFeatures) ;
    var w = window.open(redirectUrl, "", szFeatures);
    checkClose(w);
}

function checkClose(newwin) {
    if (newwin.closed) {
        _table.reLoad();
    } else {
        setTimeout(function() {
            checkClose(newwin);
        },
        1000);
    }
}

以上是关于javascript 检查打开的窗口是否关闭的主要内容,如果未能解决你的问题,请参考以下文章

javascript 检查浏览器窗口何时关闭

javascript 检查浏览器窗口何时关闭

检查打开的窗口是不是已关闭

HTML / Javascript检查窗口关闭并执行功能[重复]

JS window.open()打开新窗口、监听新窗口关闭事件

window备忘录