3
我想解析一个JSON响应使用jQuery从last.fm和获取经度和纬度值。持有这些值的JSON的部分看起来像这样:如何解析JSON,如geo:point?
"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:拉特“不起作用。我如何使用“:”获取这些值?