Javascript 解析复杂的json jquery
我正在尝试获取以下json数据:Javascript 解析复杂的json jquery,javascript,jquery,arrays,json,traversal,Javascript,Jquery,Arrays,Json,Traversal,我正在尝试获取以下json数据: { "count": 96, "value": { "title": "cotripWeatherStations", "description": "Pipes Output", "link": "http:\/\/pipes.yahoo.com\/pipes\/pipe.info?_id=f43ccc14ab9d1c88d537236e93c1525e", "pubDate": "Mon, 03 Sep 2012 02
{
"count": 96,
"value": {
"title": "cotripWeatherStations",
"description": "Pipes Output",
"link": "http:\/\/pipes.yahoo.com\/pipes\/pipe.info?_id=f43ccc14ab9d1c88d537236e93c1525e",
"pubDate": "Mon, 03 Sep 2012 02:17:48 +0000",
"generator": "http:\/\/pipes.yahoo.com\/pipes\/",
"callback": "",
"items": [
{
"ws:Location": {
"global:Latitude": "37.086807",
"global:Longitude": "-104.521294"
},
"ws:Device": {
"global:DeviceId": "6796",
"global:CommonName": "025N008 RATON PASS (RWIS)",
"global:Status": "enabled",
"global:EntityId": "1",
"global:RoadId": "31",
"global:RoadName": "I-25",
"global:Direction": "North",
"global:MileMarker": "8",
"global:LastUpdateDate": "2012-08-26T13:52:00.000-06:00",
"global:Icon": "theme\/cotrip.org\/images\/devices\/icon_device_weather_station_with_cam_16x23.gif"
}
}
]
}
以下代码为我提供了一个带有输出但没有数据的警报:
var weather = $.getJSON("http://pipes.yahoo.com/pipes/pipe.run?_id=f43ccc14ab9d1c88d537236e93c1525e&_render=json&_callback=?", function(json) {
alert("JSON Data: " + json.value["items"]);
});
我如何深入到这个JSON中去“ws:designe-global:CommonName”怎么样
json.value.items[0]['ws:Device']['global:CommonName']
?
怎么样
json.value.items[0]['ws:Device']['global:CommonName']
?
谢谢虫族,这真是太棒了!这是我的JSFIDLE,它显示了最重要的警报,现在我知道了如何处理这些复杂的数据,我可以继续前进了!谢谢虫族,这真是太棒了!这是我的JSFIDLE,它显示了最重要的警报,现在我知道了如何处理这些复杂的数据,我可以继续前进了!