Skip to content

Instantly share code, notes, and snippets.

@julienXX
Created January 4, 2011 10:50
Show Gist options
  • Save julienXX/764642 to your computer and use it in GitHub Desktop.
Save julienXX/764642 to your computer and use it in GitHub Desktop.
window.fbAsyncInit = function () {
FB.init({ appId: #{APP_ID}, status: true, cookie: true, xfbml: true });
/* All the events registered */
FB.Event.subscribe('auth.login', function (response) {
// do something with response
alert("login success");
});
FB.Event.subscribe('auth.logout', function (response) {
// do something with response
alert("logout success");
});
FB.getLoginStatus(function (response) {
if (response.session) {
// logged in and connected user, someone you know
alert("login success");
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment