How to Create a Cross Domain Javascript Widget With jQuery

Have you ever wondered how sites can give you a snippet of code, you paste it into yours, and like magic a widget loads into your page? For example, you put a small piece of code from Google Adsense into your site and Google will serve up dynamic advertising content.

With all the concerns for cross-site scripting (XSS), I began thinking about how this works and how to create one for my own projects. I of course started my journey into learning this useful technique with a Google Search.

I came across an article written by Alex Marandon that walks through exactly how it works with code examples.

Check it out: