Skip to content

Instantly share code, notes, and snippets.

@coolaj86
Created March 10, 2010 21:02
Show Gist options
  • Save coolaj86/328395 to your computer and use it in GitHub Desktop.
Save coolaj86/328395 to your computer and use it in GitHub Desktop.
var fb_api_key = 'xxxxxxxxxxxxxxxxxxxxxx';
var fb_channel_path = '/xd_receiver.htm';
var FBApi;
var XFBML;
FB_RequireFeatures(["Api","XFBML"], function(){
FB.XFBML.Host.autoParseDomTree = false;
// Create an ApiClient object, passing app's API key and
// a site relative URL to xd_receiver.htm
FB.Facebook.init(fb_api_key, fb_channel_path, null);
FBApi = FB.Facebook.apiClient;
XFBML = FB.XFBML.Host;
// Forces Facebook Connect / Login
FBApi.requireLogin(function(exception){
$('#params_log').append("Current user id is " + FBApi.get_session().uid);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment