我的没有问题啊
<html><script>
function show(){
  alert("ASCII代码是:"+event.keyCode);
}
</script><head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>键盘代码-51windows.com</title>
<style>
<!--
body         { font-family: Verdana; color: #000080; font-size: 9pt }
-->
</style>
</head><body onkeydown="show()"><p align="center">请按键盘</p></body></html>