首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

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

2012-03-29 
如何知道键盘按了F5刷新窗口如题,有谁知道啊。[解决办法] !DOCTYPE HTML PUBLIC-//W3C//DTD HTML 4.0 Tra

如何知道键盘按了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>

热点排行