Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the ways of transferring parameters by data in ajax

Shulou Source: shulou.com Published: 2022-06-03 14:23:16 11月14日 Update

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!

Tags: Way content article order success value interest guy partner data more format knowledge industry information information channel channel reference processing help Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple NVidia macOS Shulou Technology Huawei