Skip to content

Instantly share code, notes, and snippets.

Avatar

Tomas Danilevicius tomasdanilevicius

  • Vilnius, Lithuania
View GitHub Profile
@tomasdanilevicius
tomasdanilevicius / async_callback.js
Created October 25, 2012 13:13 — forked from necolas/snippet.js
Optimised async loading of cross-domain scripts with callback
View async_callback.js
/*
* Added callback
*
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/
* Better handling of scripts without supplied ids.
*
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
*/
(function(doc, script) {