I'd like to offer a way to my users to promote my website, blog etc. on their website. I can make a banner, logo whatever that they can embed to their site, but I'd like to offer dynamic content, like "the 5 newest entry's title from my blog".
The problem is the same origin policy. I know there is a solution (and I use it): they embed a simple div and a JavaScript file. The JS makes an XmlHttpRequest to my server and gets the data as JSONP, parses the data and inserts into the div.
But is it the only way? Isn't there a better way I could do this? On the Internet there are tons of widget (or whatever, I don't know how they call...) that gain the data from another domain. How they do that?