Skip to content

Instantly share code, notes, and snippets.

@xerxesb
Created April 7, 2013 23:43
Show Gist options
  • Save xerxesb/5333129 to your computer and use it in GitHub Desktop.
Save xerxesb/5333129 to your computer and use it in GitHub Desktop.
Include javascript dynamically
/* Modified from http://www.javascriptkit.com/javatutors/loadjavascriptcss.shtml */
var url= "";
var fileref = document.createElement('script');
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", url);
document.getElementsByTagName("head")[0].appendChild(fileref);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment