2 回答

TA貢獻(xiàn)1797條經(jīng)驗(yàn) 獲得超6個(gè)贊
(1)error屬性的使用方式是不是有問題,第一個(gè)參數(shù)jqXHR,是不是沒有message屬性,正確使用并打印出錯(cuò)誤信息可能對(duì)問題分析有幫助。以下為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屬性,不知道你在服務(wù)端是怎么處理json返回的,返回的時(shí)候weblogic和tomcat會(huì)不會(huì)有不一致的地方;

TA貢獻(xiàn)1802條經(jīng)驗(yàn) 獲得超10個(gè)贊
你寫錯(cuò)了吧:是 $.ajax 而不是 $(function(){
$.ajax({ url: "XXXX", success: function(){
}});
- 2 回答
- 0 關(guān)注
- 129 瀏覽
添加回答
舉報(bào)