摘要: function addEvent(obj,type,fn){ //用于保存上一个事件 var saved = null; //判断是否存在 if(typeof obj['on' + type] == 'function'){ saved = obj['on' ... 阅读全文
posted @ 2014-09-13 18:04 little fly 阅读(152) 评论(0) 推荐(0) 编辑
摘要: window.onload = function(){ document.onkeypress = function(evt){ var e = evt||window.event; console.log(getCharCode(evt)); };}func... 阅读全文
posted @ 2014-09-13 16:30 little fly 阅读(394) 评论(0) 推荐(0) 编辑