What HTTP status codes trigger an error event on XMLHttpRequest

I have read every specification I can find, even W3 for ProgressEvents, as well as XMLHttpRequest, and I am in relation to WHICH (or What response) status codes that fire an Error event when async XHR is requested. The most I can find are links to checking the status code itself on the object and processing that usually handles anything other than 200 like Error, but redirecting 3xx, say POST, is not an error (I cannot remember if XHR will automatically redirect) Can someone help me or point me in the right direction relative to the specification (without libraries) for all the answers that trigger the onerror event?

+5
source share
1 answer

onerrortriggered only for network-level events, which means it onloadwill fire if there is a successful response, regardless of the HTTP status code. See this question for a more detailed discussion: When should the XMLHttpRequest error handler handler

+6
source

All Articles