Monday, 20 December 2021

JS errors when changing hosts

Previously I was using managed hosting but have recently been testing a VPS server setup running CentOs with Virtualmin.

I have moved over a website which works absolutely fine on the managed hosting, but moving it to the VPS gives me multiple JS errors. For some reason, it doesn't seem to be loading any of the JS scripts. When I replace the scripts with CDN links, it all works fine again.

I've checked the directory permissions and they're set the same as the previous hosting, I can also access and read each file using website.com/js/bootstrap.min.js for example. The only difference is the JS directory itself is "Forbidden". I'm not sure if that makes a difference when I can read the actual files?

My question is, why could this be happening if JS runs similar to HTML and works fine when using the CDN scripts? Also, what is the meaning of the random IDs contained in the JS SRC scripts right before text/javascript shown below, could this be the cause?

    <script src="js/jquery-3.2.1.min.js" type="7fb652456240e11add396d8d-text/javascript"></script>
    <script src="js/bootstrap.min.js" type="7fb652456240e11add396d8d-text/javascript"></script>
    <script src="js/jquery.slicknav.min.js" type="7fb652456240e11add396d8d-text/javascript"></script>
    <script src="js/owl.carousel.min.js" type="7fb652456240e11add396d8d-text/javascript"></script>
    <script src="js/jquery.magnific-popup.min.js" type="7fb652456240e11add396d8d-text/javascript"></script>
    <script src="js/circle-progress.min.js" type="7fb652456240e11add396d8d-text/javascript"></script>
    <script src="js/mixitup.min.js" type="7fb652456240e11add396d8d-text/javascript"></script>
    <script src="js/instafeed.min.js" type="7fb652456240e11add396d8d-text/javascript"></script>
    <script src="js/masonry.pkgd.min.js" type="7fb652456240e11add396d8d-text/javascript"></script>
    <script src="js/main.js" type="7fb652456240e11add396d8d-text/javascript"></script>
<script src="js/rocket-loader.min.js" data-cf-settings="7fb652456240e11add396d8d-|49" defer></script></body>
    </html>

enter image description here



from JS errors when changing hosts

No comments:

Post a Comment