I have an AJAX call as follows:
$.ajax({
type: "get",
url: "xxx.xxx.xxx/xxx.js",
dataType: 'jsonp',
success: function(data) {
console.log("success");
}
}).done(function(data){
console.log("done");
}).fail(function(data){
console.log("fail");
}).always(function(){
console.log("always")
});
When the call succeeds, the success
and done
functions run. However, when the call fails (like when I change the url to gobbledygook) nothing runs, not even always
.
The behavior happens in both Firefox and Chrome.
I've seen a number of other people mention that it's a problem with JSONP
, and the accepted answer says that making it async: false
would work, but neither async: false
nor async: true
worked.
What seems to be the issue here?