External Javascript File Not Working
-
I am trying to combine javascript together as one external file to defer loading. I am not sure am I doing the correct thing. I got the javascript upload into my root directory in a .js file.
Then I paste the the code below below before the </body> tag.
<script defer="defer" type="text/javascript"> window.onload=function(){ var mycode; mycode=document.createElement("script"); mycode.type="text/javascript"; mycode.src="https://www.my site name.com/my external javascript file end with .js"; document.getElementsByTagName("head")[0].appendChild(mycode); } </script>
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘External Javascript File Not Working’ is closed to new replies.