以下の JSON 出力の「statisticalEvidence」から「キー」、「値」のペアとして値を取得できません。
JSON 出力:
{
"query": {
"count": 1,
"lang": "en-US",
"results": {
"entities": {
"total": "10",
"lang": "en-US",
"entity": [
{
"id": "FZZNDK3XM3VIPLW76QHCAYF2D4",
"rank": "10",
"scores": {
"score": {
"attribute": "contentCreator",
"context": "yct:001000012",
"value": "1.0",
"statisticalEvidence": "\"{\"totalNoOfAbusiveComments\":0,\"totalNoOfThumbsDown\":22,\"totalNoOfPositiveRatedComments\":70,\"totalNoOfReplies\":8,\"totalNoOfLikedComments\":20,\"totalNoOfEngagingReplies\":13,\"totalNoOfThumbsUp\":35,\"totalNoOfComments\":79}\""
}
}}
]
}
}
}
}
以下のように「id」を取得できます。
$.get(url,function(data) {
var json = jQuery.parseJSON(data);
for(var i in json.query.results.entities.entity){
var id = json.query.results.entities.entity[i].id;
}
});
statisticsEvidence の値を配列として取得する方法を教えてください。