This article is a mirror article of machine translation, please click here to jump to the original article.

View: 13252|Reply: 0

[Jquery] Use the Ajax method to POST JSON data to the background

[Copy link]
Posted on 10/11/2017 10:39:00 AM | | | |
If the project submits data to the background, if it is submitted through a form, because there is a lot of data and there are rules, it is too troublesome to submit in the form of ordinary key value

Directly submit the json data to the background, and the background will automatically convert the json into an object, and you can directly retrieve it from the object

How does ajax post submit JSON data???

First, the data we post is an array, we add data to the array first,





Then submit it in a serialized JSON string, and the ajax commit method is as follows:



We write in C# MVC in the background, and the background can automatically convert JSON strings into objects, the screenshot is as follows:






Previous:Baidu coordinates are converted to WGS84 coordinates
Next:One-click reinstallation tutorial installation assistant One-click reinstallation guide of system assistant
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com