做了很久angular项目,最近一个项目使用jquery,当用到ajax提交数组时,格式不同,查了一下资料 这里记录一下!
$.ajax({
type: "post",
data: JSON.stringify(data), // 低版本浏览器需引入 json2插件
url: url,
dataType: "json",
contentType:'application/json; charset=utf-8', //改成json jquery默认为 application/x-www-form-urlencoded;
success: function (d) {
},
error: function (e) {
}
});