Posted By

brianyang on 05/26/10


Tagged


Versions (?)

Load Script in DOM


 / Published in: JavaScript
 

  1. var s = document.createElement('script');
  2. var u = 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js';
  3. s.setAttribute('src', u);
  4. document.getElementsByTagName('body')[0].appendChild(s);
  5. console.log(u + ' loaded');

Report this snippet  

You need to login to post a comment.