Hello,
I am using the following code to get the json feed of a twitter users friends using the twitter api :
var url = "http://twitter.com/statuses/friends/"+twitter_handle+".json?callback=?";
//show ajax loading animation
$('#loading').show();
$.getJSON(url, function(data) {
//hide ajax loading animation
$('#loading').hide();
//Processing the JSON here
//...
});
This works when the twitter handle is valid.But if it is invalid,i.e. when no such twitter user exists the callback function i defined is not executed, and the ajax loading animation does not get hidden.
So, is there a way i can determine in code whether the request for the json feed is failing,and then hide the loading animation ?
Thank You.