Skip to content

Instantly share code, notes, and snippets.

@atnan
Created April 3, 2009 00:21
Show Gist options
  • Save atnan/89577 to your computer and use it in GitHub Desktop.
Save atnan/89577 to your computer and use it in GitHub Desktop.
document.observe("dom:loaded", function(loaded) {
$("login_via_facebook_connect").observe("click", function(clicked) {
FB_RequireFeatures(["Connect"], function() {
FB.init("FACEBOOK_API_KEY", "path/to/fb_crossdomain_communications_channel.html", {
ifUserConnected: function(uid) {
// SessionController#create will get the Facebook session from the
// cookie set by Facebook on the Cross Domain Communication Channel
clicked.element().up("form").submit();
}
});
FB.ensureInit(function() {
FB.Connect.requireSession();
});
});
clicked.stop();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment