我想顯示的Facebook評論數評論計數。這篇文章是幾乎正是我需要的: Facebook Graph Api url comments and shares count doesn't work anymoreFacebook的API - 在<code><div id="comments"></code></p> <p>它必須通過Facebook查詢語言(FQL)通過FQL
但是我怎麼顯示comment_count
(從查詢)到div
?即我如何處理這些數據?到目前爲止,我有:
$(function(){
$.ajax({
url: 'https://graph.facebook.com/fql?q=SELECT%20comment_count%20FROM%20link_stat%20WHERE%20url=%27e',
dataType: 'jsonp',
success: function(data) {
if(data.comment_count)
{
$('body').find('#comments').html('Comments ('+jsonp.data.comment_count+')');
}else{
$('body').find('#comments').html('Comments (0)');
}
}
});
});
這個url是完美嗎? – Hemc
嗨! - 網址只是一個例子:一個完整的網址,例如:https://graph.facebook.com/fql?q=SELECT%20comment_count%20FROM%20link_stat%20WHERE%20url=%27google.com%27 – melusinefile