1. To pass the background action to the front desk, you need to convert the map into json format
Map resultMap;
JSONObject json = JSONObject.fromObject(resultMap);
message = json.toString();
Store multiple items in List student object
2. In the front-end js, first convert the resulting json string into an object
var obj = eval("(" data ")");
3. Traverse the objects in the list
for(var key in obj){ //The first level of loop gets each list
var List = obj[key];
for(var student in List){ //The second level loop takes the objects in the list
alert(List[student ].id);
alert(List[student ].name);
}
}
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn