I want to raise an event when a popup window is closed, or preferably, just before closing. I\'m storing the popup window object as an object, but I don\'t know of any way to bi
I think I figured out what's happening:
When you use window.open
it opens a new window with location "about:blank" and then changes it to the url you provided at the function call.
So, the unload event is bound before the change from "about:blank" to the right url and is fired when the changing occurs.
I got it working with JQuery doing this:
$(function(){
var win = window.open('http://url-at-same-domain.com','Test', 'width=600,height=500');
$(win).unload(function(){
if(this.location == 'about:blank')
{
$(this).unload(function(){
// do something here
});
}
});
});