JS files not found (404)
Solution 1
Solved.
It was a permissions issue. The PATHs were right but the problematic directories and files didn't have execute permissions.
EDIT(zpert): Make sure directory permissions are 755, which means:
- Owner: Read, Write, Execute
- Group: Read, Execute
- Public: Read, Execute
Solution 2
In Chrome Developer Tools (F12 in Google Chrome), if you go to the sources tab you can see the content (css and js) that is on the page. It appears that some of your files are missing and some of the directories are incorrect.
It looks like with some of the content you assumed that support-wizard was the root directory when it isn't.
For example, some of your sources should be:
/support-wizard/libs/ladda/dist/spin.min.js
/support-wizard/libs/ladda/dist/ladda.min.js
/support-wizard/libs/bootstrap-toggle-master/css/bootstrap-toggle.min.css
If you try going to each page it should load (ie: ztsales.com/support-wizard/libs/ladda/dist/ladda.min.js)
Falpangaea
Updated on September 22, 2020Comments
-
Falpangaea over 3 years
I'm running the application locally and it works fine. When I uploaded it to my hosting account I started getting 404 errors on JS
It's happening in both Chrome and Firefox.
The files are located in the designated location and the code is at the bottom of the page so they shouldn't be getting accessed before they're loaded.
<script src="libs/bootstrap-switch-master/docs/js/jquery.min.js"></script> <script src="libs/bootstrap-toggle-master/js/bootstrap-toggle.min.js"></script> <script src="libs/angular/angular.js"></script> <script src="libs/angular/angular.min.js"></script> <script src="libs/angular-auto-validate/dist/jcs-auto-validate.min.js" ></script> <script src="libs/ladda/dist/spin.min.js" ></script> <script src="libs/ladda/dist/ladda.min.js" ></script> <script src="libs/angular-ladda/dist/angular-ladda.min.js"></script> <script src="libs/clipboard.js-master/dist/clipboard.min.js"></script> <script src="libs/jquery-color-master/jquery.color.js"></script> <script src="main.js" ></script> </body > </html >
-
Falpangaea almost 8 yearsIf I add that to the PATHs, it still doesn't load them.
-
Eitan K almost 8 yearsIt fixed some of them, if you see the spin.min.js and ladda.min.js are now loaded. You need to check the paths of the other ones as well and see what is missing. Look at the sources tab in Chrome Developer Tools it is very useful. If you try going to each page it should load (ie: ztsales.com/support-wizard/libs/ladda/dist/ladda.min.js)
-
Black Sheep almost 8 yearsThats not the problem... The problem is that the file doesn't exist anywhere.
-
Eitan K almost 8 yearsSome of them seem to be missing, but some of them seem to have the wrong directory like the ones that I posted
-
Falpangaea almost 8 yearsThey're definitely there in cpanel. Adding pics to the next post.
-
s.k.Soni almost 7 yearshow you given the permission can give you show me. I also facing same issue. Thank You.
-
Solal about 4 years@s.k.Soni run in terminal:
chmod 755 your/directory