🤯 New: Coding Assessments Practice your skills on real-world programming challenges

jQuery Capture Close of Popup Window

Sam Deering

jQuery code snippet to Capture the Close of a Popup Window.

//monitor the closing of a popup window
var win = window.open("http://dev.com/index.php?m=social&a=testLinkedIn",'','height=500,width=500');
var winTimer = window.setInterval(function()
    if (win.closed !== false)
        // !== is required for compatibility with Opera
        log('win closed...');
}, 200);