title: Kill unload function in JS?
body: <p>Is there a way to kill the unload function with javascript(jquery)?</p>
  
  <p>I am looking for something like this:</p>
  
  <pre><code>window.onbeforeunload = function(){
      confirm("Close?")
  }
  </code></pre>
  
  <p>or in jquery:</p>
  
  <pre><code>$(window).unload(function() {
      confirm("close?")
  });
  </code></pre>
  
  <p>Now, on window unload I get my confirm alert but it will continue in any case. Clicking cancel it won't stay on my page.</p>