<script> var script = document.createElement("script"); script.type = "text/javascript"; script.src = "file.js"; document.getElementsByTagName("head")[0].appendChild(script); </script>