I am trying to invoke addEventListener through apply with the code below but I am getting "TypeError: Type error" in webkit's console.
addEvent = (function (handler) {
return function (element, event, fn) {
handler.apply(element, [event, fn, false]);
};
}(addEventListener || attachEvent));
I have tried both apply and call to invoke the method but to no avail. Am I missing something obvious or trying to do something not allowed for some reason I don't know yet?
Another article is talking about this a little bit but not exactly how I am trying to work with it; Using native code functions as JavaScript objects in WebKit.