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
9FB.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 })