+ -
当前位置:首页 → 问答吧 → [已解决]ajax遇到parsererror,但不知道怎么捕获

[已解决]ajax遇到parsererror,但不知道怎么捕获

时间:2009-03-18

来源:互联网

如题,google了半天也没找到有用的资源
有的说是返回的状态 status:(timeout, error, notmodified, success, parsererror这几种)
也有说是error的一种状态
比如 error:function(xmlHttpRequest, msg){
//这里的msg参数可能是time,error,parsererror...
}

到底要怎么捕获这个parsererror呢?
[ 此帖被kukat在2009-03-18 11:41重新编辑 ]

作者: kukat   发布时间: 2009-03-18

找到了
http://docs.jquery.com/Ajax/jQuery.ajax

引用
A function to be called if the request fails. The function is passed three arguments: The XMLHttpRequest object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "notmodified" and "parsererror". This is an Ajax Event.

作者: kukat   发布时间: 2009-03-18