Created
February 9, 2012 12:31
-
-
Save cjbell/1779690 to your computer and use it in GitHub Desktop.
Facebook Login
This file contains hidden or 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
<div id="fb-root"></div> | |
<script src="https://connect.facebook.net/en_US/all.js"></script> | |
<script type="text/javascript" charset="utf-8"> | |
FB.init({ | |
appId : 'APP ID HERE', | |
status : true, | |
cookie : true, | |
xfbml : true, | |
}); | |
</script> | |
<script> | |
// Call this function once the user clicks a button | |
// Don't auto call it!! | |
FB.getLoginStatus(function(response) { | |
if (response.session) { | |
// Already logged in | |
} else { | |
FB.login(function(response) { | |
if (response.authResponse) { | |
// Logged in | |
} else { | |
// Failed | |
} | |
},{ scope:'' }); | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment