KAKAN

Testing js

Jun 14th, 2016
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function insertScript(link)
  2. {
  3.     //link is the link to the script.
  4.     var head = document.getElementsByTagName("head")[0]; //We'll insert it after the first element of head.
  5.     var script = document.createElement('script');
  6.     script.href = link;
  7.     script.type = "text/javascript";
  8.     head.appendChild(script);
  9. }
  10. /*
  11. * A simple example
  12. * This example will insert the the jquery code into the head
  13. */
  14.  
  15. insertScript("http://code.jquery.com/jquery-3.0.0.min.js");
Add Comment
Please, Sign In to add comment