Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

detect f5/refresh injavascript 1

Status
Not open for further replies.

sourabhjha

Programmer
Jan 13, 2002
121
IN
Is there any way i can detect in my javascript that f5 or refresh button has been clicked
 
here's one way, but only for IE:
[tt]
<html>
<head>
<script language=&quot;javascript&quot;>
function disableFKeys() {
// F keys are keyCodes 112 - 123
if (event.keyCode == 116) {
event.keyCode = 0;
alert(&quot;F5 pressed.&quot;);
return false;
}
}
</script>
</head>
<body onkeydown=&quot;return disableFKeys();&quot;>
<form>
</form>
</body>
</html>
[/tt] =========================================================
if (!succeed) try();
-jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top