【发布时间】:2010-09-14 21:12:35
【问题描述】:
我还有另一个与 JSON 数组相关的问题。
我将如何访问存储在“when”下的数据:如果我使用 JQuery 使用如下语句导入此数组中的数据:
function getJSON() {
$.getJSON('nearby.json',
function(data) {
console.log(data.when);
});
}
这是我的 JSON 中的一个 sn-p:
[
[
"Soon",
[
{
"body": "",
"updated": "2010-06-25T09:53:50.868000",
"distance": 27.679736723643234,
"when": "lunchtime",
"item_types": [
5
],
"ccnt": 12,
"loc": {
"lat": 37.774929499999999,
"lon": -122.4194155
}
}
]
]
]
【问题讨论】: