读书人

怎么知道键盘按了F5刷新窗口

发布时间: 2012-03-29 12:53:13 作者: rapoo

如何知道键盘按了F5刷新窗口
如题,有谁知道啊。

[解决办法]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN ">

<html>
<head>
<meta http-equiv= "pragma " content= "no-cache ">
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 ">
<title> 新建网页 </title>
<style type= "text/css ">
body{

}
</style>
</head>
<body>
<script language= "javascript ">
document.onkeydown = function(){
if (116==event.keyCode){
alert( "按F5刷新 ")
}
}
</script>
</body>
</html>

读书人网 >JavaScript

热点推荐