I need help to convert json to javascript object
就allow me to access
这样 "json.data.audience.infomation"
_get the values in the json arrays?
因为我想用里面的值来做“if else 比较”
这是我的 json 结构:
{
"data": [
{
"id": "/en/chelsea_fc",
"topic": "Chelsea F.C.",
"audience": [
{
"userid": "100003914111287",
"information": [
{
"category": "Athlete",
"source": "Didier Drogba"
},
{
"category": "Athlete",
"source": "Frank Lampard"
},
{
"category": "Professional sports team",
"source": "Chelsea Football Club"
},
{
"category": "favorite_teams",
"source": "Chelsea Football Club"
}
]
},
{
"userid": "100003914111287",
"information": [
{
"category": "Athlete",
"source": "Didier Drogba"
},
{
"category": "Athlete",
"source": "Frank Lampard"
},
{
"category": "Professional sports team",
"source": "Chelsea Football Club"
},
{
"category": "favorite_teams",
"source": "Chelsea Football Club"
}
]
}
],
"type": "/soccer/football_team"
},
{
"id": "/en/manchester_united_fc",
"topic": "Manchester United F.C.",
"audience": [
{
"information": [
{
"category": "Athlete",
"source": "Ryan Giggs"
},
{
"category": "Professional sports team",
"source": "Manchester United"
},
{
"category": "favorite_teams",
"source": "Manchester United"
}
],
"userid": "100003921730958"
}
],
"type": "/soccer/football_team"
}
]
}