
06-12-2005, 01:56 AM
|
|
SEO Junior
|
|
Join Date: Jun 2005
Posts: 1
|
|
|
onkeyup and backspace key
Hi,
Firstly, I want to say I am new on javascript.
I want to remove backspace key. I mean that when user presses backspace key, I will prevent user to go back page. But user can press any part of the page, not speficific part. I thought that I can do this operation in body tag. And I wrote this code;
Code:
<body onkeyup="blockbackspace(this)">
And there is a javascript function;
Code:
function blockbackspace(n){
if (event.keyCode == 8){
????
}
}
As you see above, when user press backpace "if (event.keyCode == 8)" is true. But what should I do rest of this? Altough I wrote this javascript the back page is loaded. How can I prevent?
|