Posted By

mracoker on 03/24/10


Tagged

javascript insert


Versions (?)

Dynamically Insert External JavaScript with JavaScript


 / Published in: JavaScript
 

  1. var headID = document.getElementsByTagName("head")[0];
  2. var newScript = document.createElement('script');
  3. newScript.type = 'text/javascript';
  4. newScript.src = 'http://www.somedomain.com/somescript.js';
  5. headID.appendChild(newScript);

Report this snippet   <

You need to login to post a comment.