Skip to content

Instantly share code, notes, and snippets.

@jiggliemon
Created August 16, 2011 02:34
Show Gist options
  • Save jiggliemon/1148329 to your computer and use it in GitHub Desktop.
Save jiggliemon/1148329 to your computer and use it in GitHub Desktop.
A Better way to handle window.fbAsyncInit
/*
Requires:
- Events: https://gist.github.com/884484
- Extend: https://gist.github.com/1049896
- Namespace: https://gist.github.com/1006005
*/
SML = Object.namespace('SML',new Events);
window.fbAsyncInit = function(){
FB.init({
appId: 'your app id',
status: true,
cookie: true
});
SML.fireEvent('FB.ready:latched');
};
SML.addEvent('FB.ready',function(){
FB.api('/me', function(response) {
console.log(response);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment