Skip to content

Instantly share code, notes, and snippets.


Tomas Danilevicius tomasdanilevicius

  • Vilnius, Lithuania
View GitHub Profile
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
* 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) {