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.
Chrome Inspect Element Errors
The directory structure
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 >
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.
Chrome Inspect Element Errors
The directory structure
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 >
Share
Improve this question
asked May 16, 2016 at 19:34
FalpangaeaFalpangaea
1912 gold badges2 silver badges8 bronze badges
5
- Here is the link: ztsales./support-wizard – Falpangaea Commented May 16, 2016 at 19:34
-
The files either aren't in the directory you think they are (have you looked?), or they haven't even been uploaded. Only you can know for sure where those files are, and whether they're accessible. If you browse into
libs
do you then see additional directories likeangular
? And if you go into those additional directories do you see the files in question? – mferly Commented May 16, 2016 at 19:42 - You should hide all your directory from public access... ztsales./support-wizard/libs – Black Sheep Commented May 16, 2016 at 19:45
- Yes, they are there. It was running perfectly fine on a local Tomcat. – Falpangaea Commented May 16, 2016 at 19:47
- if you put directly in your browser (for example): ztsales./support-wizard/libs/angular/angular.min.js They didn't found... If you put: ztsales./support-wizard/libs you didn't found the directory angular... – Black Sheep Commented May 16, 2016 at 19:59
2 Answers
Reset to default 3In 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./support-wizard/libs/ladda/dist/ladda.min.js)
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