Skip to content

Instantly share code, notes, and snippets.

@ntotten
Created October 7, 2012 04:00
Show Gist options
  • Select an option

  • Save ntotten/3847055 to your computer and use it in GitHub Desktop.

Select an option

Save ntotten/3847055 to your computer and use it in GitHub Desktop.
Facebook jQuery Helper
$(document).ready(function() {
// Add the function to run after FB is initialized
$(document).on('fb:initialized', function() {
FB.getLoginStatus(fbAuthStatusChange);
});
$(document).fb('youappid');
});
function fbAuthStatusChange(request) {
// Do something
}
$(document).on('fb:initializing', function() {
// Do something before FB.Init is called
});
$(document).on('fb:initialized', function() {
// Do something after FB.Init is called
});
$(document).fb('youappid');
$(document).fb('youappid');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment