I'm sending a simple Ajax request to Twitter.
$.ajax({
type: "GET",
url: "https://api.twitter.com/1/users/show.json?screen_name=twitterAPI&include_entities=true",
dataType: "jsonp",
success: function(data, textStatus, jqXHR){
console.log("success");
},
error : function(XMLHttpRequest, textStatus, errorThrown){
console.log("error");
}
});
When I the screen_name exist, the success function is called. But when the screen_name does not exist, I get a Javascript error on my console but the error function is never called.
Where is the mistake?