ajx使用总结, 1.使用ajx提交参数,如何改变data中的参数名 1).正常使用时如下: $.ajax({ url: store.get("path")+"/offdoc/phone_"+s, type:"POST", dataType: "json", data:{ loginName : loginName, key : key, pid : pid, penetrate : 'cas', devicetype : 'phone', processInsId : $("#processInsId").val(), workItemId : $("#workItemId").val(), approveNotion : $("#spyj").val().replace(/ /g,"<br />"), 'BPMPara:participantNames' : myTag.getPeopleListName() }, success:function(data){ if(data.success){ alert("提交成功"); } } }); 2).如下方式是可以修改data参数名的 var subJson = '"userId":"'+user.id +'","processInsId":'+processInsId +',"workItemId":'+workItemId +',"opinion":"'+newopinion +'","approvename":"'+user.name +'","loginName":"'+loginName +'","key":"'+key +'","pid":"'+pid +'","formurl":"'+formurl +'","penetrate":"cas","devicetype":"phone"'; $.ajax({ url: store.get("path")+"/review/processreview.do", type:"POST", dataType: "json", data:eval("({"+subJson+"})"), success:function(data){ if(data.success){ console.log("成功"); } }, error:function(data) { mui.toast("提交审批失败"); } }); 这种方式中data的参数名是不能动态变化获取的,