title: JQuery getJSON function
body: <p>I am using the following code to get the json feed of a twitter users friends using the twitter api :</p>
  
  <pre><code>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
     //...
  }); 
  </code></pre>
  
  <p>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.</p>
  
  <p>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 ?</p>
  
  <p>Thank You.</p>