javascript 事件处理示例分享(2)

_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事件处理分为三个阶段:捕获 - 处理 - 起泡。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wgxdxy.html