jsonp example
by pisamce
HTML
<input id="url" type="text" value="http://example.com" />
<input id="btn" type="button" value="Get page html" />
<pre id="res"></pre>
JavaScript
var res = document.getElementById('res'),
url = document.getElementById('url')
myVar = '';
window.show = function (jsonp) {
myVar = jsonp[0].body; //assign response to your variable
res.innerText = myVar;
}
document.getElementById('btn').addEventListener('click', function () {
var s = document.createElement('script');
s.src = 'http://jsonpwrapper.com/?urls%5B%5D=' + encodeURIComponent(url.value) + '&callback=show';
document.getElementsByTagName('head')[0].appendChild(s);
});