I use this code to get some information from twitter via their api:
$.ajax({
url : apiUrl,
cache : false,
crossDomain: true,
dataType: "jsonp",
success : function(html) {
},
error: function(jqXHR, textStatus, errorThrown) {
console.log(jqXHR);
}
});
However, if the apiUrl variable provides the correct URL, this code works fine, the ei success object executes, but if the URL is incorrect, ei Error 404 is returned from twitter, the error object never executes. It does not write anything to the console. How to check the status of error 404 in this case?
source
share