$.ajax({
type : "post",
url : url,
contentType : 'application/json;charset=UTF-8',
data : {
"distributioncategorys" : JSON.stringify(data)
},
success : function(re) {
el.modal("hide");
},
error : function(XMLHttpRequest, textstatus, errorThrown) {
alert("121错误:" + errorThrown + "\n"
+ XMLHttpRequest.responseText);
}
}); data代表数组,后台用String distributioncategorys 字段接受,然后把字符串转为自己需要的对象,注意:当后台用字符串接收时去除ajax中的dataType : "json",,否则报错,
contentType : 'application/json;charset=UTF-8', 也去除
type : "post",
url : url,
contentType : 'application/json;charset=UTF-8',
data : {
"distributioncategorys" : JSON.stringify(data)
},
success : function(re) {
el.modal("hide");
},
error : function(XMLHttpRequest, textstatus, errorThrown) {
alert("121错误:" + errorThrown + "\n"
+ XMLHttpRequest.responseText);
}
}); data代表数组,后台用String distributioncategorys 字段接受,然后把字符串转为自己需要的对象,注意:当后台用字符串接收时去除ajax中的dataType : "json",,否则报错,