jquery ajax请求返回进入error事件

jquery版本1.10.1

由于服务端返回的json 数据格式问题,前端js一直进入 error 事件。

正确的格式:

"{\"responseMsg\":\"success\"}"



备注:
$.ajax({
url:'/deep/sysmng/addPermRes',
async:true,
method:'POST',
contentType:'application/x-www-form-urlencoded; charset=UTF-8',
data:'resourceIds='+resourceIds,
dataType : 'json',
error:function(jqXHR,textStatus,errorThrown ){alert(errorThrown)},
success:function(resp){
alert('success');
}
});

猜你喜欢

转载自javawxl.iteye.com/blog/2368625