How can I capture the F5/Refresh key?

Sivasubramanian Shanmuga Sundaram

Use the following code.

<head>
<script language="javascript">
///for IE
function test()
{
  if(event.keyCode == 116)
  {
      ///do anything
   }
}
///for Netscape
window.captureEvents(Event.KEYUP);
window.onKeyup = test;
function test(event)
{
  if(event.keyCode == 116)
  {
      ///do anything
   }
}
</script>
 <body onkeyup="test()">
</body>
regards,
shanmyselva
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact