Click to See Complete Forum and Search --> : I wanna stop F5 refreshing stuff!
Epadeam
06-18-2003, 09:28 AM
Hi All,
Does anyone know if there is a way to stop F5 from refreshing an entire frameset, I only want it to refresh the main frame, not all of them. Anything I can do on a keydown event for the F5 key? Any ideas??
Thanx
_LOBO_
06-18-2003, 09:47 AM
I found this script I think this should WORK:
html>
<head>
<script language="JavaScript1.2">
function keyPressed(evt) {
var F5 = 116;
if(document.layers) {
if (evt.which == F5) {
return false;
}
}else if(document.all){
if (event.keyCode == F5) {
event.keyCode = 0;
window.event.returnValue = false;
}
}
}
function click(e) {
if (document.all) {
if (event.button == 2) {
alert("Sorry, that function is disabled");
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert("Sorry, that function is disabled");
return false;
}
}
}
if(document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.captureEvents (Event.KEYDOWN);
}
document.onkeydown=keyPressed;
document.onmousedown=click;
</script>
</head>
<body>
</body>
</html>
Epadeam
06-18-2003, 09:51 AM
Cheers I'll give that a go! :)
_LOBO_
06-18-2003, 09:55 AM
;)