【发布时间】:2010-10-31 20:02:04
【问题描述】:
我正在尝试使用来自 last.fm 的 jquery 解析 JSON 响应并获取经度和纬度值。保存这些值的 JSON 部分如下所示:
"location":{"geo:point":{"geo:lat":"58.409901","geo:long":"15.563306"}
我得到的代码是这样的:
$.getJSON("http://ws.audioscrobbler.com/2.0/?method=artist.getevents&artist=familjen&api_key=xformat=json&callback=?",
function(data){
$.each(data.events.event, function(i,item){
$("#menucontent").append("<br/>"+item.title + " " + item.venue.location.geo:point.geo:lat);
});
});
显然“item.venue.location.geo:point.geo:lat”部分不起作用。如何使用“:”获取这些值?
【问题讨论】:
标签: jquery json parsing last.fm