I am opening a popup window and attaching an onbeforeunload event to it like this:
win = window.open(http://www.google.com, , width=300px,height=300px);
win.onbeforeunload = function() {
//do your stuff here
alert(Closed);
};
If I leave the URL empty, the new popup opens with about:blank as the address but when I close it, I see the alert.
If I open in as you see it (with an external URL), once it's closed, I cannot see the alert anymore. Any idea why this is happening?