Created
March 29, 2012 21:55
-
-
Save rogeruiz/2244151 to your computer and use it in GitHub Desktop.
Loading Facebook and Twitter API hooks responsibly
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
/** | |
* Load Twitter's API Hook Async | |
* Company: Rokkan (rokkan.com) | |
* Author: Roger Steve Ruiz ([email protected]) | |
*/ | |
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 ([email protected]) | |
*/ | |
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