posts - 121,  comments - 184,  trackbacks - 5
公告
  2011年11月2日

获取事件的event对象,以及获取按键码,其他浏览器也兼容

var evt = window.event || arguments.callee.caller.arguments[0];
var charCode = (evt.which) ? evt.which : evt.keyCode;

 

备忘。

posted @ 2011-11-02 14:19 零度的火 阅读(18) 评论(0) 编辑