Created
April 3, 2009 00:21
-
-
Save atnan/89577 to your computer and use it in GitHub Desktop.
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
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