$.ajax(
{
url : "http://search.twitter.com/search.json?q=google&lang=en&rpp=10&since_id=&callback=?",
dataType : 'json',
success : function(data)
{
alert(data.results.length);
}
});
How exactly is this working ? I mean the cross-domain request.
I believe that jQuery realises it’s cross domain and so adds a script tag to the page header with the appropriate src attribute (rather than firing of an ajax request). This loads the JSON and then fires the callback.