我在json格式的链接上有这个,我必须检索app>
将其存储到常规javascript对象中。
最佳答案
var obj = JSON.parse({"vehicles":[{"name":"motorcycle","wheels":2,"maxCapacity":2,"currentPassengers":1,"maxSpeed":"260 km/h"},{"name":"car","wheels":4,"maxCapacity":4,"currentPassengers":3,"maxSpeed":"220 km/h"},{"name":"aeroplane","wheels":18,"maxCapacity":416,"currentPassengers":215,"maxSpeed":"920 km/h"}]})
那么您可以用作
obj.vehicles
来访问车辆。