3 ms·
I’m not familiar with Node, but static event handlers aren’t usually referred to as callbacks in that context. “Callback” implies that something is being called
by layer8 2y ago
I’m not familiar with Node, but static event handlers aren’t usually referred to as callbacks in that context. “Callback” implies that something is being called, for it to call back to the client code. That’s not what’s happening with the onxxx event handlers. There is no “back” there. The event loop simply calls “forward” into the JavaScript code.
- pavlov 2y agoI don’t know what you mean by “forward” because there is no difference between these two: img.onload = function() {…} img.src = “some url” img.load(“some url”, function() {…}) The early JavaScript APIs use the first style, but the result is the same.