var script = document.createElement('script'); script.src = 'path/to/script.js'; document.getElementsByTagName('head')[0].appendChild(script);