Skip to content

Instantly share code, notes, and snippets.

@gcpantazis
Created November 21, 2011 18:58
Show Gist options
  • Save gcpantazis/1383556 to your computer and use it in GitHub Desktop.
Save gcpantazis/1383556 to your computer and use it in GitHub Desktop.
Embedding a script into the DOM
c = document.createElement('script');
c.type = 'text/javascript';
c.src = 'URL TO SCRIPT';
(document.getElementsByTagName('head')[0] || document.getElemntsByTagName('body')[0]).appendChild(c);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment