window.onload = function(){ document.getElementsByTagName('head')[0].innerHTML = '<script src="path/script.js" type="text/javascript"><\/script>'; };