. if .
http://docs.jquery.com/Ajax/jQuery.getJSON :
callback ()
, , .
function (data, textStatus) {
this;
}
Edit
: jQuery ajax (jsonp) - .
var twitter_handle = 'FakePersonx';
var url = "http://twitter.com/statuses/friends/"+twitter_handle+".json?callback=?";
$.jsonp({
type: "GET",
url: url,
data: {},
async:true,
contentType: "application/json; charset=utf-8",
dataType: "jsonp",
success: function(data) {
alert(data);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert('error');
},
beforeSend: function (XMLHttpRequest) {
alert('Before Send');
$('#loading').show();
},
complete: function (XMLHttpRequest, textStatus) {
alert('Complete');
$('#loading').hide();
}
});