/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
loadExternalJScript : function(scriptURL, id){ var script = document.createElement('script'); script.src = scriptURL; script.id = id; script.type = 'text/javascript'; script.charset = 'utf-8'; // Add the script to the head, upon which it will load and execute. var head = document.getElementsByTagName('head')[0]; head.appendChild(script); }