Why jQuery does not raise any error event when I execute following script?
thought I have registered the error event, but it is not fired.
chrome shows me following error in Network tab in Console.
GET http://www.google.com/adfdaf?callback=jQuery15204572567550931126_1321347602706&_=1321348668347 404 (Not Found)
javascript:
$.ajax({
type: "GET",
url: 'http://google.com/adfdaf?callback=?',
dataType: "jsonp",
success: function (msg) {
console.log('Custom Domain validated successfully.');
},
error: function () {
console.log('Error occured while validating Custom Domain.');
}
});
The jQuery docs for
.ajaxstate the following:You can use
.getJSONinstead. For example:Edit
Looks like that won’t work either. It seems the workaround is to supply a
timeoutoption to.ajax:Obviously, that’s not ideal, but the error handler will run after 5 seconds.