
Ask HN: Teach me to write 3rd party java script please? - kirillzubovsky
Could someone please help me understand everything I would want to know in order to create third-party JS widget, like twitter embeds or facebook ads, in the shortest amount of time?<p>I am okay getting 80% of the value in 20% of the time, for now, and would love to know of any guides, pitfalls, and best practices for writing such widgets.<p>Basically, I will consume anything you&#x27;re willing to throw my way so I could get from 0 to 1 asap. Appreciate it!
======
ktpsns
There is no magic in these widgets. People have to add certain snippets,
mostly a JavaScript file from some CDN and some basic HTML tags where these
widgets shall appear, and everything else is done by the JavaScript.

In former days, people used iframes, this was even easier because the iframe
could basically show any website with its own styling, scripting, etc.

If you want to get hands dirty, then skip any framework, learn modern
ECMAscript, vanilla Dom and try out to modify a well known element in the
target page from your script.

~~~
kirillzubovsky
From what I understand the scripts usually find an anchor in the page, then
load some iframe/html content and update the anchor with new data. That in
itself doesn't seem too bad, but ... it can't be that easy. I mean, each one
of those widgets usually is 100s lines of code. I feel like I am missing
something very important.

