Created
December 24, 2011 23:10
-
-
Save jescalan/1518505 to your computer and use it in GitHub Desktop.
Facebook getLoginStatus Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Facebook getLoginStatus Example</title> | |
</head> | |
<body> | |
<p>Check out the console to see if anything appears.</p> | |
<p>HERE'S THE CODE:</p> | |
<pre> | |
$(function(){ | |
FB.init({ apiKey: '203642573046113', status: true }); | |
FB.getLoginStatus(function(response) { | |
if (response.status === 'connected') { | |
console.log(response); | |
} else if (response.status === 'not_authorized') { | |
console.log('not connected to app'); | |
} else { | |
console.log('not logged in to fb'); | |
} | |
}); | |
}); | |
</pre> | |
<div id='fb-root'></div> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
<script src="http://connect.facebook.net/en_US/all.js"></script> | |
<script> | |
$(function(){ | |
FB.init({ apiKey: '203642573046113', status: true }); | |
FB.getLoginStatus(function(response) { | |
if (response.status === 'connected') { | |
console.log(response); | |
} else if (response.status === 'not_authorized') { | |
console.log('not connected to app'); | |
} else { | |
console.log('not logged in to fb'); | |
} | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's defined here
http://connect.facebook.net/en_US/all.js