3 回答

TA貢獻(xiàn)1846條經(jīng)驗 獲得超7個贊
jQuery.ajax
dataType
Content-Type
dataType: "json"
將響應(yīng)計算為JSON并返回一個JavaScript對象。[…]JSON數(shù)據(jù)是以嚴(yán)格的方式解析的;任何格式錯誤的JSON都會被拒絕,并拋出一個解析錯誤。[…]空響應(yīng)也被拒絕;服務(wù)器應(yīng)該返回NULL或{}響應(yīng)。
200 OK
parseerror
.
dataType
Content-Type: application/javascript alert("Record Deleted");
Content-Type: application/json{"message": "Record deleted"}

TA貢獻(xiàn)1869條經(jīng)驗 獲得超4個贊
dataType
$.ajax({ type: 'POST', url: 'Jqueryoperation.aspx?Operation=DeleteRow', contentType: 'application/json; charset=utf-8', data: json, dataType: 'text json', cache: false, success: AjaxSucceeded, error: AjaxFailed});

TA貢獻(xiàn)1802條經(jīng)驗 獲得超10個贊
$.ajax({ type: 'POST', url: 'Jqueryoperation.aspx?Operation=DeleteRow', contentType: 'application/json; charset=utf-8', data: json, dataType: 'json', //**** REMOVE THIS LINE ****// cache: false, success: AjaxSucceeded, error: AjaxFailed});
添加回答
舉報