Skip to content

Instantly share code, notes, and snippets.

@rogeruiz
Created March 29, 2012 21:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rogeruiz/2244151 to your computer and use it in GitHub Desktop.
Save rogeruiz/2244151 to your computer and use it in GitHub Desktop.
Loading Facebook and Twitter API hooks responsibly
/**
* Load Twitter's API Hook Async
* Company: Rokkan (rokkan.com)
* Author: Roger Steve Ruiz (roger.ruiz@rokkan.com)
*/
Modernizr.load([{
load: '//platform.twitter.com/widgets.js',
complete: function(){
twttr.ready(function(){
// Do the JavaScripts here, dood.
}
}
}]);
/**
* Load Facebook's API Hook Async
* Company: Rokkan (rokkan.com)
* Author: Roger Steve Ruiz (roger.ruiz@rokkan.com)
*/
Modernizr.load([{
load: '//connect.facebook.net/en_US/all.js',
complete: function(){
// Initialize FB
window.fbAsyncInit = function(){
// Do the JavaScripts here, dood.
};
}
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment