3 ms·
The problem appears to be, some tend to get confused, who is the caller and who is the callee. For this, please just consider that the DOM-interface is not part
by masswerk 13y ago
The problem appears to be, some tend to get confused, who is the caller and who is the callee. For this, please just consider that the DOM-interface is not part of the language, but just -- as the name suggests -- an interface to a separate environment. From the point of view of the DOM, the element is the callee, which applies itself to a callback function (the event-handler). Makes quite some sense.
In case you've issues with this, you may just use `Object.handleEvent()`, and the this-object will be your object (or function). Why is everyone complaining about this behavior, but no one is using the built-in feature that would be the perfect solution to the problem?