Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q1668 In Internet Explorer 4 if I press the backspace key, and no element has focus, it behaves as if the history back button was clicked, how do I trap this event and disable it?

irt.org | Knowledge Base | JavaScript | Event | Q1668 [ previous next ]

Q1668 In Internet Explorer 4 if I press the backspace key, and no element has focus, it behaves as if the history back button was clicked, how do I trap this event and disable it?

Try:

<script language="JavaSCript"><!--
function mykeyhandler() {
   if (window.event && window.event.keyCode == 8) { // try to cancel the backspace
      window.event.cancelBubble = true;
      window.event.returnValue = false;
      return false;
   }
}

document.onkeydown = mykeyhandler;
//--></script>

Feedback on 'Q1668 In Internet Explorer 4 if I press the backspace key, and no element has focus, it behaves as if the history back button was clicked, how do I trap this event and disable it?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.