Skip to content

Instantly share code, notes, and snippets.

@Alexgalinier
Created September 24, 2014 06:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Alexgalinier/a72aeef34a8d320ebbe6 to your computer and use it in GitHub Desktop.
Save Alexgalinier/a72aeef34a8d320ebbe6 to your computer and use it in GitHub Desktop.
Load a script manually with "async" attribute
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = 'http://yourdomain.com/script.js';
var x = document.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment