Skip to content

Instantly share code, notes, and snippets.

@joshje
Created January 10, 2012 01:14
Show Gist options
  • Save joshje/1586145 to your computer and use it in GitHub Desktop.
Save joshje/1586145 to your computer and use it in GitHub Desktop.
Asyncronously load javascript by passing in a URL
function async(url) {
var a = document.createElement('script');
a.async = true;
a.src = url;
var b = document.getElementsByTagName('script')[0];
b.parentNode.insertBefore(a, b);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment