Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function insertScript(link)
- {
- //link is the link to the script.
- var head = document.getElementsByTagName("head")[0]; //We'll insert it after the first element of head.
- var script = document.createElement('script');
- script.href = link;
- script.type = "text/javascript";
- head.appendChild(script);
- }
- /*
- * A simple example
- * This example will insert the the jquery code into the head
- */
- insertScript("http://code.jquery.com/jquery-3.0.0.min.js");
Add Comment
Please, Sign In to add comment