Wednesday, June 6, 2012

Browser event firing when closing the browser ?.

<script>   
      var hook = true;
      window.onbeforeunload = function() {
        if (hook) {
alert("action");
                   }
      }
      function unhook() {
         alert("2");
        hook=false;
      }
</script>

No comments:

Post a Comment