var data=[{name:“a”,age:12},{name:“b”,age:11},{name:“c”,age:13},{name:“d”,age:14}];
for(var o in data){
alert(o);
alert(data[o]);
alert(“text:”+data[o].name+" value:"+data[o].age );
}
JS 循环遍历JSON数据
最新推荐文章于 2023-11-02 09:48:14 发布
var data=[{name:“a”,age:12},{name:“b”,age:11},{name:“c”,age:13},{name:“d”,age:14}];
for(var o in data){
alert(o);
alert(data[o]);
alert(“text:”+data[o].name+" value:"+data[o].age );
}