jQuery Ajax中的errorThrown返回未定义? [英] errorThrown in Jquery Ajax Returns Undefined?

查看:337
本文介绍了jQuery Ajax中的errorThrown返回未定义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据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."

http://jsfiddle.net/RafuW/9/

问题:

如果是,为什么会返回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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆