title: How can I prevent the backspace key from navigating back?
body: <p>On IE I can do this with the (terribly non-standard, but working) jQuery</p>
  
  <pre><code>if ($.browser.msie)
      $(document).keydown(function(e) { if (e.keyCode == 8) window.event.keyCode = 0;});
  </code></pre>
  
  <p>But is it possible to do in a way which works on Firefox, or in a cross-browser way for a bonus?</p>
  
  <p>For the record:</p>
  
  <pre><code>$(document).keydown(function(e) { if (e.keyCode == 8) e.stopPropagation(); });
  </code></pre>
  
  <p>does nothing.</p>
  
  <pre><code>$(document).keydown(function(e) { if (e.keyCode == 8) e.preventDefault(); });
  </code></pre>
  
  <p>solves the problem, but renders the backspace key unusable on the page, which is even worse than the original behaviour.</p>
  
  <p>EDIT:
  The reason I do this is that I'm not creating a simple web page but a large application. It is incredibly annoying to lose 10 minutes of work just because you pressed backspace in the wrong place. The ratio of preventing mistakes vs. annoying users should be way above 1000/1 by preventing the backspace key from navigating back.</p>
  
  <p>EDIT2: I'm <strong>not</strong> trying to prevent history navigation, just accidents.</p>
  
  <p>EDIT3: @brentonstrines comment (moved here since the question is so popular): This is a long-term 'fix', but you could throw your support behind the <a href="http://code.google.com/p/chromium/issues/detail?id=144832" rel="noreferrer">Chromium bug to change this behavior in webkit</a></p>