You will be limited to SOP ( XMLHttpRequest
can only be done in a URI in the same domain; JSON can only be retrieved using this method). To get around this, you will have to use JSONP instead ( another explanation * ).
The endpoint seems to support JSONP , so you can do:
function foo(response) { // response is already a JavaScript object } var script = document.createElement("script"); script.src = "http://search.twitter.com/search.json?q=bacon&callback=foo"; document.body.appendChild(script);
* Disclaimer: Yes, this is my blog
Matt source share