我有一个JSON响应,我通过执行
在javascript中转换为字符串var myObject = JSON.stringify(data);
这打印出结果很好,但我需要能够提取特定数据,如myObject.route.locationSequence [1]或myObject.route.distance。然而,这些似乎都不起作用。以下是我的JSON回复。
{
"route": {
"hasTollRoad": false,
"computedWaypoints": [],
"fuelUsed": 5.67,
"hasUnpaved": false,
"hasHighway": true,
"realTime": -1,
"boundingBox": {
"ul": {
"lng": -77.863792,
"lat": 40.811218
},
"lr": {
"lng": -76.30574,
"lat": 39.962482
}
},
"distance": 142.909,
"time": 9872,
"locationSequence": [
0,
2,
1,
3
]
}
}
答案 0 :(得分:0)