在js里模拟了一段json数据,为什么读取不出来这个啊,总说未定义。var jsonObj = { "name" : "市级和地区", "total" : [
{ "city":["大兴区","东城区","西城区"], "area":[
["一号街","二号街","三号街"],
["四号街","五号街","六号街"],
["七号街","八号街","九号街"]
]
}
}console.log(jsonObj.total[0].area.length);//报错 说area未定义写成console.log(jsonObj.total0.area.length); //还是不行可是:console.log(jsonObj.total[0].city.length); //就可以行得通求助 谢谢
添加回答
举报
0/150
提交
取消