Posted By

LeeRJohnson on 11/09/08


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

rwczippy


Runtime Javascript Load


 / Published in: JavaScript
 

  1. function loadHeadScript(url) {
  2. var script = document.createElement("script");
  3. script.setAttribute("type", "text/javascript");
  4. script.setAttribute("src", url);
  5. var head = document.getElementsByTagName("head")[0];
  6. head.appendChild(script);
  7. }
  8.  
  9. function loadBodyScript(url) {
  10. var script = document.createElement("script");
  11. script.setAttribute("type", "text/javascript");
  12. script.setAttribute("src", url);
  13. var body = document.getElementsByTagName("body")[0];
  14. body.appendChild(script);
  15. }

Report this snippet  

You need to login to post a comment.