【发布时间】:2011-02-04 08:26:25
【问题描述】:
我有一个非常简单的 JSON 数组(请关注 "points.bean.pointsBase" 对象):
var mydata =
{"list":
[
{"points.bean.pointsBase":
[
{"time": 2000, "caption":"caption text", duration: 5000},
{"time": 6000, "caption":"caption text", duration: 3000}
]
}
]
};
// Usually we make smth like this to get the value:
var smth = mydata.list[0].points.bean.pointsBase[0].time;
alert(smth); // should display 2000
但是,不幸的是,它没有显示任何内容。
当我将 "points.bean.pointsBase" 更改为名称中不带点的 smth 时 - 一切正常!
但是,我不能将此名称更改为没有点的其他名称,但我需要获取一个值?!
有什么办法可以得到吗?
【问题讨论】:
标签: javascript json arrays object