How to acces items in deeply nested JSON object?
本问题已经有最佳答案,请猛点这里访问。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | Object meta: Object objects: Array[4] 0: Object id: 19222 leaguevine_url:"https://www.leaguevine.com/tournaments/19389/autumn-2013/pools/#19222" name:"D" resource_uri:"https://api.leaguevine.com/v1/pools/19222/" standings: Array[4] 0: Object 1: Object games_played: 0 losses: 0 plus_minus: 0 points_allowed: 0 points_scored: 0 team: Object id: 21195 leaguevine_url:"https://www.leaguevine.com/teams/21195/smokum/" name:"Smokum" resource_uri:"https://api.leaguevine.com/v1/teams/21195/" short_name:"" __proto__: Object team_id: 21195 wins: 0 __proto__: Object 2: Object 3: Object length: 4 __proto__: Array[0] start_time:"2013-10-21T09:00:00+02:00" team_ids: Array[4] time_between_rounds: 120 time_created:"2013-09-30T09:30:46.577758+00:00" time_last_updated:"2013-09-30T09:30:46.577791+00:00" tournament: Object tournament_id: 19389 __proto__: Object 1: Object 2: Object 3: Object |
这些是我从leaguevine API获得的JSON对象。我怎样才能使用团队名称"smokum"?
除了使用Transparency Micro库将JSON对象呈现为HTML之外,我不知道如何使用JavaScript访问对象中的对象。
假设您发布的json是
埃多克斯1〔2〕