этот код работает для меня
<script>
// fb init
window.fbAsyncInit = function() {
FB.init({
appId: 'you app id',
status: true,
cookie: true,
xfbml: true
});
// this event is fired where a comment is created
FB.Event.subscribe('comment.create', function(response) {
alert(response.commentID);
});
};
// im using jquery to make ajax request
$(function(){
$.ajax({
url: "http://graph.facebook.com/?ids=[SITE URL]",
dataType: 'json',
success: function(data){
var items = [];
$.each(data, function(key, val) {
items.push(val)
});
alert(items[0].comments);
console.log(items);
}
});
items [0] .comments - это то, что вы ищете
Посмотрите в консоли, вы можете увидеть, что элементы выглядят так:
[Object {
id="site url",
shares=65,
comments=87
}]