title: How to callback a function on 404 in JSON ajax request with jQuery?
body: <p>I want to make an Ajax request with response in JSON. So I made this Ajax request:</p>
  
  <pre><code>$.ajax({
      url: 'http://my_url',
      dataType: "json",
      success: function(data){
        alert('success');
      },
      error: function(data){
        alert('error');
      },
      complete: function(data) {
        alert('complete')
      }})
  </code></pre>
  
  <p>This code works good but when my url send me a HTTP code 404, no callbacks are used, even the complete callback.
  After research, it's because my dataType is 'json' so 404 return is HTML and the JSON parsing failed. So no callback.</p>
  
  <p>Have you a solution to call a callback function when a 404 is raised ?</p>
  
  <p>EDIT: complete callback don't call is return is 404. If you want an URL wit 404 you can call : <a href="http://twitter.com/status/user_timeline/jksqdlmjmsd.json?count=3&amp;callback=jsonp1269278524295&amp;_=1269278536697" rel="noreferrer">http://twitter.com/status/user_timeline/jksqdlmjmsd.json?count=3&amp;callback=jsonp1269278524295&amp;_=1269278536697</a> it's with this URL I have my problem.</p>