4 ms·
I'm not talking about how my javascript source files are organized, I'm talking about how the functions are dispatched from the UI. That is done with event list
by jeremyjh 5y ago
I'm not talking about how my javascript source files are organized, I'm talking about how the functions are dispatched from the UI. That is done with event listeners strewn about in the DOM.
- pphysch 5y agoWhat is so complicated about <input id="initMyWidget" type="button" value="Play" onclick="mywidget.initGame();"/> If you are referring to "the page is the widget" then you need to make a very good case why wrapping all the HTML in JS is in your interest. Facebook has an interest in doing this because they want to wrap every element in a bit of JS so they can closely track user behavior. Briefly hovering over a link, button or ad? Facebook wants to know everything about that interaction, in order to provide value to their clients (i.e. advertisers). A normal developer is happy with that element just being a `<a>` or `<input>`. The entire page does not need to be a JS widget (SPA).