Hey, all.
I seem to be able to catch F5 when it's pressed (calling a function using the BODY tag's onkeydown event and checking for a keyCode of 116), but I still can't seem to prevent the page from reloading.
This is all I've tried so far:
Is it (what I want to do) do-able?
Thanks.
--Dave
I seem to be able to catch F5 when it's pressed (calling a function using the BODY tag's onkeydown event and checking for a keyCode of 116), but I still can't seem to prevent the page from reloading.
This is all I've tried so far:
Code:
<html>
<head>
<script>
function rejectF5()
{
if(event.keyCode == 116)
return false;
}
</script>
</head>
<body onkeydown='return rejectF5();'>
<script>
document.write(new Date()); [b]//I use this to see if page reloads.[/b]
</script>
</body>
</html>
Is it (what I want to do) do-able?
Thanks.
--Dave