I want to create a javascript badge that displays a list of links. We host the javascript on our domain. Other sites can put an empty div tag on their page and at the botto
It took me some time to find this answer on Stackexchange because I was using different search terms. I believe that the link suggested there is a more complete answer than the ones already given here:
How to build a web widget (using jQuery)
It covers:
- ensure the widget’s code doesn’t accidentally mess up with the rest of the page,
- dynamically load external CSS and JavaScript files,
- bypass browsers’ single-origin policy using JSONP.