Return to Snippet

Revision: 63956
at June 21, 2013 18:10 by cappellin


Initial Code
<script>
	window.onbeforeunload = function () {
		return "Type your text here";
	};
</script>

Initial URL


Initial Description
This snippet uses the <code>onbeforeunload</code> event to ask users whether they want to remain on the current page or navigate to a new URL.

Initial Title
onbeforeunload Event

Initial Tags


Initial Language
JavaScript