js监听 window.open 关闭事件

转载自:http://blog.csdn.net/hanshileiai/article/details/41346729

首先创建一个新的对象,这将打开一个弹出这样的:

var winObj = window.open('http://www.google.com','google','width=800,height=600,status=0,toolbar=0');

为了知道这个弹出窗口关闭,你就必须保持与像下面这样的循环检查这一点:

var loop = setInterval(function() {   
    if(winObj.closed) {  
        clearInterval(loop);  
        alert('closed');  
    }  
}, 1000);

原文地址:https://www.cnblogs.com/zrui-xyu/p/4869247.html