title: jQuery Disable All Redirections (Links, Form Submissions, window.location changes etc)
body: <p>Is it possible to use javascript to disable <strong>any code</strong> that would take the browser away from the current page?</p>
  
  <p>I have tried the following code but it didn't work:</p>
  
  <pre><code>$(window).unload(function(e){
      event.stopPropagation();
      event.preventDefault();
      return false;
  });
  </code></pre>
  
  <p>I'm guessing this code doesn't work because by the time of unload(), it's too late.</p>
  
  <p>Any other ideas?</p>
  
  <p>Possible implementations:
  1. disable any code that redirects
  2. bind to all elements that can do this (links, forms, what else am i missing?)</p>