use "which":<HEAD>
<SCRIPT LANGUAGE="JavaScript1.2"><!--
function netscapeKeyPress(e) {
     alert(e.which + ' pressed');
}function microsoftKeyPress() {
    alert(window.event.keyCode + ' pressed');
}if (navigator.appName == 'Netscape') {
    window.captureEvents(Event.KEYPRESS);
    window.onKeyPress = netscapeKeyPress;
}
//--></SCRIPT></HEAD><BODY onKeyPress="microsoftKeyPress()">
<FORM>
<TEXTAREA>
</TEXTAREA>
</BODY>

解决方案 »

  1.   

    在netscape6下还是不好用?e这个参数怎么传递?
      

  2.   

    在NN6里,当你按下键时,回触发 onkeydown, onkeypress, 和 onkeyup 事件,可以用 event.which == 数字 来进行捕捉。
      

  3.   

    look carefully at the code, you will see that e is passed in as a parameter by the browser, or you can access it with arguments[0] if you do not set the parameter
      

  4.   

    但确实是不好用,alert(e.which + ' pressed');没出现
      

  5.   

    net_lover(孟子E章) :在netscape6下
    if (event.which==13) alert("success");没有反应
    karma(无为):
    how to use arguments[0].could you give me an example?thank you!
      

  6.   

    我的也是在netscape6下event.which用不了,why?