title: onbeforeunload confirmation screen customization
body: <p>Is it possible to create a custom confirmation box for the onbeforeunload event in a browser? I tried but then I get 2 confirmation boxes (one from me which is nothing more than return confirm... and then the standard one from the browser).</p>
  
  <p>At the moment my code looks like:</p>
  
  <pre><code>var inputChanged = false;
  
  $(window).load(function() {
      window.onbeforeunload = navigateAway;
      $(':input').bind('change', function() { inputChanged = true; });
  });
  
  function navigateAway(){
      if(inputChanged){
          return 'Are you sure you want to navigate away?';
      }
  }
  </code></pre>
  
  <p>I'm using jQuery for this.</p>