We Recommend

Pro JavaScript Techniques Pro JavaScript Techniques
Pro JavaScript Techniques is the ultimate JavaScript book for the modern web developer. It provides everything you need to know about modern JavaScript, and shows what JavaScript can do for your web sites. This book doesn't waste any time looking at things you already know, like basic syntax and structures.


Posted By

inamorix on 09/27/07


Tagged

js


Versions (?)


Who likes this?

3 people have marked this snippet as a favorite

francisre
korzhik
wizard04


require


Published in: JavaScript 


  1. function require (js) {
  2. var d = document;
  3. var el = d.createElement('script');
  4. var head = d.getElementsByTagName('head')[0];
  5.  
  6. el.src = js;
  7. el.type = 'text/javascript';
  8. head.appendChild(el);
  9. }

Report this snippet 

You need to login to post a comment.