'[{"imgPath": "C","price": "B","specDesc": "C"},{"imgPath": "D","price": "E","specDesc ": "F"}]' This is a parameter for an ajax request. How do I get the data on the page and create it in a loop to form a json? How should I do it? Please answer me! ! !
This is the page
Press the control to take out the value, form an object literal, and then format it into JSON... To determine what kind of data is generated, you need to know how the interface is agreed upon.
Making a pair should be simple, like
Generating JSON is just one sentence
JSON.parse()
var arr = [];
var param = {}
You can use mockjs to simulate a lot of data.