jQuery Ajax中的errorThrown返回未定义? [英] errorThrown in Jquery Ajax Returns Undefined?
问题描述
根据jQuery:
发生HTTP错误时, errorThrown 会收到 HTTP状态,例如未找到"或内部服务器错误".
When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error."
问题:
如果是,为什么会返回undefined
错误代码?
If so , Why does it return an undefined
error code?
p.s. (我know
我可以从jqXHR obj中获取not found
的详细信息-但仍然-我想为 errorThrown 部分提供答案).
p.s. ( I know
I can get the details for not found
from the jqXHR obj - but still - I want an answer for the errorThrown part).
推荐答案
似乎您使用的jQuery版本不支持该参数.如果在jsFiddle中使用jQuery 1.5.2,您的代码将返回NOT FOUND
.
It appears that the version of jQuery you're using doesn't support that argument. If use jQuery 1.5.2 in jsFiddle your code will return NOT FOUND
.
这篇关于jQuery Ajax中的errorThrown返回未定义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!