53

The documentation doesn't seem to specify exactly what is meant by 'success' in jQuery.ajax. Is it any 2xx code? Only 200?

2 Answers 2

84

From the source code:

if ( status >= 200 && status < 300 || status === 304 ) {

So any 2xx and under special circumstances 304 as well. 304 has some extra handling though, check the source for more info.

Sign up to request clarification or add additional context in comments.

1 Comment

Angular js considers 304 a error, and triggers the error event
4

You'll find this in the done callback. A success is any status greater than or equal to 200 and less than 300. A notmodified (304) is also viewed as a success.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.