0
如何檢查訪客是否喜歡Facebook粉絲頁面。所以我填我的APP_ID,PAGE_ID代碼如何檢查Facebook粉絲頁面是否受到歡迎
這是我必須得
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({
appId : 'APP_ID',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true, // parse XFBML
channelUrl : 'http://domain.com/tab/', // channel.html file
oauth : false // enable OAuth 2.0
});
(function($) {
var session = FB.getSession();
FB.api({
method: 'fql.query',
query: 'SELECT uid, page_id FROM page_fan WHERE uid=me() AND page_id=PAGE_ID'
},
function(response) {
if(response instanceof Array && response.length > 0)
alert("YOU LIKE US!");
else
alert("YOU DON'T LIKE US YET!");
});
})(jQuery);
</script>
我得到這個錯誤後的代碼:
TypeError: FB.getSession is not a function
你將需要爲這個user_likes –