When exactly does jquery.ajax trigger an error callback?

I can not find this in the documentation. I also skipped the jquery source and can no longer find the information.

Using jquery.ajax, when can I expect the failure callback to be triggered?

In addition to the following:

  • connection problem (for example, a lost connection with a mobile device)
  • server is down and not responding

    // EDIT: added after comments, thank you very much @charlietfl:

  • http error code equal to or more than 400

  • missing CORS headers

What are the other cases where jquery will trigger a fail callback?

+4
source share
1 answer

, 4xx 5xx, . .

+2

Source: https://habr.com/ru/post/1614077/


All Articles