4 ms·
What is so complicated about <input id="initMyWidget" type="button" value="Play" onclick="mywidget.initGame();"/> If you are referring to "the page is the wid
by pphysch 5y ago
What 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).