Hi,
Is it possible to figure out just wich type of event triggered $(window).unload();? To be a bit more specific, I'm only interested in the event when a user has closed the window (a popup), not when he's just navigating away from the current page.
I've looked into the event parameter passed to the callback of unload(); but there doesn't seem to be anything in that object, that'll be of use.
Does anybody know a solution to this?
Code:
$(function() {
$(window).unload(function(event) {
// This is obviously pseudo code. Help me fix it!
if(event.type == 'closing') { // I had expected something along these lines to work
// Do stuff before the window closes
}
});
});