I have a lot of code that use addEventListener in minified libraries, files ..., but I need to make work this code in IE8, so replacing addEventListener with addEvent:
/* * Register the specified handler function to handle events of the specified * type on the specified target. Ensure that the handler will always be * invoked as a method of the target. */ function addEvent(type, handler) { if (this.addEventListener) this.addEventListener(type, handler, false); else { this.attachEvent("on" + type, function(event) { return handler.call(this, event); }); } } I can "override" window.addEventListener, but how can I override this method in the other objects?
Thanks in advance Regards