$.ajax({ type: "post", url: "../maintain_standard/add.htm", dataType : 'json', contentType:'application/json', data:JSON.stringify(thisData), async:false, success: function(res){ window.confirm(res.msg); }, error: function(res){ console.log(res); alert("操作失败"); } });
2.data:
var thisData={ "name":$("#name").val(),//标准名称 "deviceType":$("#deviceType").val(),//设备类型 "deviceTypeDetail":$("#deviceTypeDetail").val(),//类型细化 "maintainType":$("#maintainType").val(),//保养类型 "maintainStandardItem1s":tableData2, }
3 tableData2 为数组 [{"name":"s"},{"name":"5"}]