Sorry for asking stupid question but I really need to trigger this event..
In jQuery I have:
$(document).ready();
Which will get call when DOM is loaded.
Now I want to call function when DOM is closed or its no longer in use or some other DOM loaded instead of current DOM.
So for that, I'm using following event but it's not getting triggered when I'm navigating to some other page.
$( window ).unload(function() {
alert( "Handler for .unload() called." );
});
Can anyone point me in right way?