JavaScript
Article
By Sam Deering

jQuery Capture Close of Popup Window

By Sam Deering

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

--ADVERTISEMENT--

//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
        window.clearInterval(winTimer);
        log('win closed...');
    }
}, 200);
Recommended
Sponsors
The most important and interesting stories in tech. Straight to your inbox, daily. Get Versioning.
Login or Create Account to Comment
Login Create Account