var script = document.createElement('script'); script.src = "https://www.examplesite/myscript.js"; document.head.appendChild(script);