JavaScript
Article

jQuery Capture Close of Popup Window

By 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
        window.clearInterval(winTimer);
        log('win closed...');
    }
}, 200);

No Reader comments

Recommended
Sponsors
Because We Like You
Free Ebooks!

Grab SitePoint's top 10 web dev and design ebooks, completely free!

Get the latest in JavaScript, once a week, for free.