O
Obi Wan Shinobi
I can't seem to prevent the refresh associated with F5 in Netscape. I
can capture the key but returning false does not prevent the refresh.
The code is as follows:
function keyDown(e) {
if (navigator.appName == 'Netscape') {
if(e.which == 116) {
alert('This action is prohibited');
e.cancelBubble = true;
return false;
}
}
// IE gives me no problem at all...
if (navigator.appName == 'Microsoft Internet Explorer') {
if (window.event.keyCode == 116) {
window.event.keyCode = 0;
alert('This action is prohibited');
return false;
}
}
}
document.onkeydown = keyDown;
if (navigator.appName == 'Netscape')
document.captureEvents(Event.KEYDOWN)
Thanks in advance.
can capture the key but returning false does not prevent the refresh.
The code is as follows:
function keyDown(e) {
if (navigator.appName == 'Netscape') {
if(e.which == 116) {
alert('This action is prohibited');
e.cancelBubble = true;
return false;
}
}
// IE gives me no problem at all...
if (navigator.appName == 'Microsoft Internet Explorer') {
if (window.event.keyCode == 116) {
window.event.keyCode = 0;
alert('This action is prohibited');
return false;
}
}
}
document.onkeydown = keyDown;
if (navigator.appName == 'Netscape')
document.captureEvents(Event.KEYDOWN)
Thanks in advance.