简体   繁体   中英

Unable to load javascript file on server but work on local

I have a php file that load a dummy js script like this:

<script type="text/javascript" src="js/test.js"></script>

The script just contain an alert to show that the script has been imported:

alert("script is load");

When I run my website locally everything is fine but when I import it to my server and that I open the website online my script test.js is not loaded and I have no error message. While exploring the dom I realize that the inclusion of the js script is not even written. How is that possible?

Check your file name. Linux systems are case sensitive. this explains why its working on local and not on server as the filename case is must be a mismatch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM