Posted By

erikportin on 05/26/11


Tagged

javascript facebbok


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Priestd09


Check if user liked page | Javascript | Facebook


 / Published in: JavaScript
 

  1. <script src="http://connect.facebook.net/en_US/all.js"></script>
  2. <script>
  3. FB.init({
  4. appId : 'APPID',
  5. status : true, // check login status
  6. cookie : true, // enable cookies to allow the server to access the session
  7. });
  8.  
  9. FB.api({ method: 'fql.query', query: 'SELECT uid FROM page_fan WHERE uid=UID AND page_id=PAGEID' },
  10. function(result) {
  11. if (result.length){
  12. //is fan
  13. }
  14.  
  15. else {
  16. //is not fan
  17. }
  18. })

Report this snippet  

You need to login to post a comment.