_self.addEvent = addEvent;
_self.addPropertyChangeEvent = addPropertyChangeEvent;
_self.removeEvent = removeEvent;
_self.loadEvent = loadEvent;
_self.stopEvent = stopEvent;
_self.stopPropagation = stopPropagation;
_self.getEvent1 = getEvent1;
_self.getEvent2 = getEvent2;
_self.getEvent3 = getEvent3;
}
var eventUtil = new EventUtil();
eventUtil.loadEvent(function () {
eventUtil.addEvent(document, "click", function (e) {
alert(eventUtil.getEvent3(e));
});
eventUtil.addPropertyChangeEvent(document,function(e){
alert(eventUtil.getEvent3(e));
});
});
</script>
javascript事件处理分为三个阶段:捕获 - 处理 - 起泡。