jquery window close event

jQuery(window).bind(‘beforeunload’,function(e){
//save info somewhere
return ‘are you sure you want to leave?’;
});

jQuery(window).unload(function(){
//I will call my method

});

Author: bm on February 13, 2014
Category: jquery