I have a little problem understanding
[Dispatched ... ] When the request has failed.
[Dispatched ... ] When the request has successfully completed.
As mentioned in the comments,
onerror fires when there is a failure on the network level. If the error only exists on the application level, e.g., an HTTP error code is sent, then
onload still fires. You need to test the returned status code explicitly in your
Note that a denied cross-domain request will also fire the