Posted By

cappellin on 06/21/13



Versions (?)

onbeforeunload Event

 / Published in: JavaScript

This snippet uses the onbeforeunload event to ask users whether they want to remain on the current page or navigate to a new URL.

  1. <script>
  2. window.onbeforeunload = function () {
  3. return "Type your text here";
  4. };
  5. </script>

Report this snippet  

You need to login to post a comment.