SoFunction
Updated on 2025-03-03

JavaScript method to detect whether the pop-up window has been closed

This article describes the method of JavaScript to detect whether a pop-up window has been closed. Share it for your reference. The specific implementation method is as follows:

Copy the codeThe code is as follows:
var win = ('','windowName',"width=200,height=200,scrollbars=no");
var timer = setInterval(function() {  
    if() { 
        clearInterval(timer); 
        alert('closed'); 
    } 
}, 1000);

I hope this article will be helpful to everyone's JavaScript programming.