> $.ajax({ > async: true, > url: testingURL, > success: function () { > location.reload(); > }, > error: function (XMLHttpRequest, textStatus, > errorThrown) { > console.log('error throw'); > console.log(errorThrown); > } > }); > > the requested page can return 404 or 403 error codes > but the errorThrown variable is ALWAYS undef... > any idea ??
errorThrown is for JavaScript errors (think try/catch). 40X responses are not "thrown", they are just errors returned from the server and you can get details from the xhr (ie: xhr.statusText). Mike