22 Sept 2015

How to Warn user if Back is pressed

Warn user if Back is pressed:

================================
This is same as above. Difference is instead of capturing close event here we capture back button event. So that we know if user is moving awaw from this webpage.
window.onbeforeunload = function() { 
 return "You work will be lost."; 
};
Share:

0 comments:

Post a Comment