什么HTTP状态codeS算作jQuery.ajax成功? [英] What HTTP status codes count as success in jQuery.ajax?
本文介绍了什么HTTP状态codeS算作jQuery.ajax成功?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
借助文档似乎并没有明确指定由jQuery.ajax'成功'的意思。这是任何2XX code?只有200?
The documentation doesn't seem to specify exactly what is meant by 'success' in jQuery.ajax. Is it any 2xx code? Only 200?
推荐答案
从源头code:
if ( status >= 200 && status < 300 || status === 304 ) {
因此,任何2XX,在特殊情况下,304也是如此。 304有一些额外的处理虽然,检查源获取更多信息。
So any 2xx and under special circumstances 304 as well. 304 has some extra handling though, check the source for more info.
这篇关于什么HTTP状态codeS算作jQuery.ajax成功?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文