摘要:
1 //自定义事件 2 function EventTarget() { 3 this.handlers = {}; 4 } 5 EventTarget.prototype = { 6 constructor: EventTarget, 7 //注册 8 addHandler: function(type, handler) { 9 if (typeof this.handlers[type] == "undefined") {10 this.handlers[type] = [];11 ... 阅读全文