To make a confirmation prompt before leaving the page in javascript you can use the following snippet.
Sample Javascript
window.onbeforeunload = function(){ var msg = 'Do you really want to leave this page?'; return msg; };
To make a confirmation prompt before leaving the page in javascript you can use the following snippet.
window.onbeforeunload = function(){ var msg = 'Do you really want to leave this page?'; return msg; };