/ Published in: JavaScript

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<script src="http://connect.facebook.net/en_US/all.js"></script> <script> FB.init({ appId : 'APPID', status : true, // check login status cookie : true, // enable cookies to allow the server to access the session }); FB.api({ method: 'fql.query', query: 'SELECT uid FROM page_fan WHERE uid=UID AND page_id=PAGEID' }, function(result) { if (result.length){ //is fan } else { //is not fan } })
Comments
