What I\'m trying to achieve is to Warn the user of unsaved changes if he/she tries to close a page or navigate away from it without saving first.
I\'ve managed to g
$(window).bind('beforeunload',function() { return "'Are you sure you want to leave the page. All data will be lost!"; }); $('#a_exit').live('click',function() { $(window).unbind('beforeunload'); });
Above works For me.