2 回答

TA贡献1797条经验 获得超6个赞
(1)error属性的使用方式是不是有问题,第一个参数jqXHR,是不是没有message属性,正确使用并打印出错误信息可能对问题分析有帮助。以下为jquery api的说明:
error
Type: Function( jqXHR jqXHR, String textStatus, String errorThrown )
A function to be called if the request fails. The function receives three arguments: The jqXHR (in jQuery 1.4.x, 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", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." As of jQuery 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: This handler is not called for cross-domain script and cross-domain JSONP requests. This is an Ajax Event.
(2)怀疑:datatype属性,不知道你在服务端是怎么处理json返回的,返回的时候weblogic和tomcat会不会有不一致的地方;

TA贡献1802条经验 获得超10个赞
你写错了吧:是 $.ajax 而不是 $(function(){
$.ajax({ url: "XXXX", success: function(){
}});
- 2 回答
- 0 关注
- 133 浏览
添加回答
举报