Skip to content

Instantly share code, notes, and snippets.

@xnzac
Created October 5, 2011 11:01
Show Gist options
  • Save xnzac/1264178 to your computer and use it in GitHub Desktop.
Save xnzac/1264178 to your computer and use it in GitHub Desktop.
Load javascript onto an existing web page
var script= document.createElement('script');
script.type= 'text/javascript';
script.src= '/js-file.js';
document.head.appendChild(script);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment