Advertisement
rAthus

Insert jQuery in a page using raw JavaScript

Mar 19th, 2013
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var head = document.getElementsByTagName('head')[0];
  2. var script = document.createElement('script');
  3. script.type = 'text/javascript';
  4. script.src = 'http://code.jquery.com/jquery-latest.min.js';
  5. script.onload = function()
  6. {
  7.     // jQuery code here
  8. }
  9. head.appendChild(script);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement