Created
June 13, 2011 09:52
-
-
Save first65/1022546 to your computer and use it in GitHub Desktop.
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
$(document).ready -> | |
$("#fb-root").append('<script type="text/javascript" src="'+ document.location.protocol +'//connect.facebook.net/en_GB/all.js" async="true"></script>') | |
window.fbAsyncInit = () -> | |
FB.init({appId: '172659579460514', status: true, cookie: true, xfbml: true}) | |
FB.Event.subscribe('auth.login', (response) -> | |
FB.api('/me', (response) -> | |
$authorId = response.id | |
$authorName = response.name | |
FB.Event.subscribe('auth.logout', (response) -> | |
$authorId = "" | |
$authorName = "" | |
FB.getLoginStatus (response) -> | |
if(response.session) | |
FB.api '/me', -> | |
$authorId = response.id | |
$authorName = response.name | |
else | |
$authorId = "" | |
$authorName = "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment