发布网友 发布时间:2022-04-24 09:33
共2个回答
热心网友 时间:2022-04-11 04:01
jq框架下,给个示例,仅供参考:
var objs = $.parseJSON('[{"name":"aaa","age":"22"},{"name":"bbb","age":"33"}]');热心网友 时间:2022-04-11 05:19
var i = 0,
str = ' [{"name":"aaa","age":"22"},{"name":"bbb","age":"33"}] ',
arr = JSON.parse(str),
len = arr.length;
for (i; i < len; i++) {
console.log(arr[i].name);
console.log(arr[i].age);
}
还望采纳谢谢,如有问题请联系我