var url = 'https://graph.facebook.com/?ids=http://www.stackoverflow.com';
$.getJSON(url, function(resp) {
$("p").html('comments = ' + resp.comments);
});
これにより、次の html が my に配置されます<p>
。comments = undefined
呼び出しから取得している戻り文字列は次のとおりです。
{
"http://www.thinlinebetween.com/tuesday-quote-of-the-day-jean-ingelow/": {
"id": "http://www.thinlinebetween.com/tuesday-quote-of-the-day-jean-ingelow/",
"shares": 2,
"comments": 1
}
}
値を取得するには、次のようなことをする必要がありresp."http://www.thinlinebetween.com/tuesday-quote-of-the-day-jean-ingelow/".comments
ますか? 返される json を解析するのは簡単ではありません。ありがとう!