Home > Net >  External Javascript File is not working on first load
External Javascript File is not working on first load

Time:07-05

Currently i am working on a website but when i visit another page from my homepage that particular page script file is not loaded on first load and after i click on refresh it works fine.

CodePudding user response:

Are you including the script in the head tag or in the body tag? You should add the script in the body tag.

CodePudding user response:

Are you including your script as well?

<head>
    <script src="script.js"></script>
</head>

or:

<body>
    <script>
        //your code here
    </script>
</body>
  • Related