CatC
json文件
$.getJSON(geocodingAPI, function (json) {
var array = [];
for (var key in json) {
var item = json[key];
array.push({
name: item.player.player-name ,
position: item.player.player-stats.position,
yd: item.player.player-stats.passing-yards,
pa: item.player.player-stats.passing-touchdowns,
});
}
}
);
答案 0 :(得分:0)
拳头使你的JSON有效。在这里我更新了有效的JSON:
{
"players": {
"player": {
"player-name": "Aaron Rodgers",
"player-stats": {
"position": "QB",
"passingYards": 327,
"passingTouchdowns": 3
}
}
}
}