0

My JavaScript code does not run on GitPages. It should display a background slideshow, but instead... does nothing. Other people experiencing the same issue mostly fix their problem by using the https protocol instead of of http.

However, I'm using relative filepaths src="js/script.js".

I've tried using https protocol with relative filepaths src="https://js/script.js.

I've tried using https protocol with absolute filepaths src="https://github.com/absolute_path/js/script.js"

I've tried embedding the script in the html document itself, rather than calling an external file <script> JavaScript code </script>

All of these work fine on my local machine, but none of them work on GitPages. The rest of the site works fine, including CSS--it's just the JavaScript that's not working. I'm new to GitHub and have no experience with JavaScript, so your help and patience is greatly appreciated.

GitPages page and repository

user72959
  • 69
  • 1
  • 6

1 Answers1

4

Your images are named 1.JPG in the repository but are referenced as 1.jpg in your CSS. Github file paths are case-sensitive, so you need make "jpg" uppercase in slide.css. Your js (only modernizr.js) appears to be loading fine.

If you are using a mac, your local filesystem is case insensitive so it would work fine locally.

ty.
  • 10,924
  • 9
  • 52
  • 71