Skip to content

Instantly share code, notes, and snippets.

@bondarewicz
Created November 28, 2013 12:08
Show Gist options
  • Select an option

  • Save bondarewicz/7690874 to your computer and use it in GitHub Desktop.

Select an option

Save bondarewicz/7690874 to your computer and use it in GitHub Desktop.
JS: Confirm leaving page
window.onbeforeunload = function() {
return 'You will lose all changes if you leave this page.';
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment