JS关闭窗口时触发

window.onbeforeunload = onbeforeunload_handler;
function onbeforeunload_handler() {
    if (document.readyState == "complete") {
        window.opener.returnValue();
    }
}

猜你喜欢

转载自blog.csdn.net/qq_32109957/article/details/86688691