how can i get the page like status using FB JS SDK? i have done this in php sdk. i just cant figure it out on JS.
i currently have this block of codes:
var session = FB.getSession();
FB.api({
method: ‘fql.query’,
query: ‘SELECT uid, page_id FROM page_fan WHERE uid=’ + session.uid + ‘ AND
page_id=188073501230086’
},
function(response) {
if(response instanceof Array && response.length > 0)
alert(“YOU LIKE US!”);
else
alert(“YOU DON’T LIKE US YET!”);
}
I’m really so newb when it comes to javascript, so i really dont know what i am missing. do i have to include some js files?
Works fine for me. I liked your page (http://www.facebook.com/pages/Alarm-Data-Security/188073501230086?sk=wall) ran that code and it worked. You need to make sure that you have permissions for that user though by calling FB.getLoginStatus like so: