You are here: irt.org | FAQ | JavaScript | Event | Q1521 [ previous next ]
Do it by redirecting the keyboard action on another keycode that you can control (backspace in this example):
function cancelRefresh() {
// keycode for F5 function
if (window.event && window.event.keyCode == 116) {
window.event.keyCode = 8;
}
// keycode for backspace
if (window.event && window.event.keyCode == 8) {
// try to cancel the backspace
window.event.cancelBubble = true;
window.event.returnValue = false;
return false;
}
}This function is called on the onKeyDown event and it seems to work!