JavaScript not working or images not showing

When working on a hosting, it should be taken into account that the Windows operating system does not distinguish between uppercase and lowercase letters in files, unlike the operating systems of the Linux family that is installed on the server. In this regard, you should take into account that if you specify the name of the image in HTML as Background.jpg, and the file in reality will be called background.jpgthen it will be displayed on the local Windows machine, but not on Linux.

To avoid this, we do not recommend using in file names:

  • Capital letters.
  • Spaces and special characters.
  • Cyrillic symbols.

Also for debugging and troubleshooting, you can use the developer tools in the browser (usually opened by clicking F12) Is a very powerful tool that no professional webmaster can work without. We highly recommend to study it for everyone who is engaged in the creation of sites.

To troubleshoot incorrect loading of images, styles, JavaScript and other files, we recommend that you follow the steps similar to these:

  1. Open the page of the site that is experiencing problems in your browser.
  2. Open developer tools by clicking F12 or combination Ctrl+Shift+I.
  3. In the window that appears, switch to the tab «Network» («Network»):
  4. Refresh the open page (for example, with Ctrl+F5).
  5. After reloading the page, a report will be displayed in the developer tools, in which you can easily find page elements that are not loading:
  6. By hovering the mouse cursor over the item that returned a 404 response when requested, you can see the full path to the file on the server:
  7. Opening the received path on FTP and we see that the file sample-1.jpg arecalled Sample-1.jpg and because of this they are not loaded. Rename a file from Sample-1.jpg in sample-1.jpg solves the problem.