What are the ways of transferring parameters by data in ajax
This article mainly introduces the ways of transmitting parameters by data in ajax. It is very detailed and has certain reference value. Friends who are interested must finish reading it.
The details are as follows:
1. POST method:
/ * * order cancellation * @ return {Boolean} whether the processing was successful * / function orderCancel (orderId, commant) {var flag = false Ajax ({type: "POST", url: ".. / order/orderCancel.action", / / orderModifyStatus data: {"orderId": orderId, "commant": commant}, dataType: "json", async:false, cache:false, success: function (data) {var member = eval ("(" + data+ ")"); / / packet data is parsed to json format if (member.success== "true") {flag = true } else if (member.success== "false") {alert (member.info);}, error: function (json) {alert ("order cancellation exception, please refresh and try again.");}}); hidediv (); return flag;}
2. GET method:
Data: "orderId=" + orderId + "& commant=" + commant are all the contents of the article "what are the ways to transfer parameters to data in ajax". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!