Guest User

Untitled

a guest
Oct 16th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. window.addEventListener("beforeunload", function (e) {
  2. var confirmationMessage = 'It looks like you have been editing something. '
  3. + 'If you leave before saving, your changes will be lost.';
  4.  
  5. (e || window.event).preventDefault && (e || window.event).preventDefault();
  6. (e || window.event).returnValue = confirmationMessage; //Gecko + IE
  7.  
  8. return confirmationMessage; //Gecko + Webkit, Safari, Chrome etc.
  9. });
Add Comment
Please, Sign In to add comment