"koethler" <ko******@telus .net> wrote in message news:<45******* *************** ********@localh ost.talkaboutpr ogramming.com>. ..
The method I used to get your script to work is this. First I put the
'onKeyDown' handler in the <body> tag. Second inside the keyHit() function
I made the first line--
var evt = window.event;
--the code works in this format in IE, though I don't know about any cross
browser application.
Do you know anything about how to disable the Backspace Key from
performing the history.back method? I can disable it for text but not for
browsing.
I simplified the code on Grant Wagner's advice to:
<html>
<head><title>Re ading Keystrokes</title>
<script type="text/javascript">
document.onkeyd own = keyHit;
function keyHit(evt) {
evt = evt || window.event;
alert(evt.which ? evt.which : evt.keyCode);
}
</script>
</head><body></body></html>
Turns out my original problem was I had document.onkeyD own instead of
document.onkeyd own (lowercase). Now it works fine under Mozilla & IE6.
Thanks folks. I am very new js. With that in mind, I have pages
1,2,3,4. Link on p. 1 takes you p. 2 which checks for cookies & if
false, does a
this.location.h ref="page3.html "
P. 3 first line is
<meta http-equiv=refresh content="0;url= page4.html">
A link in page 4 then takes you to p. 2. Backward navigation from p.2
now takes you to p.1 with pages 3 & 4 erased from history.
Something to think about.
KK