Why doesn't js on the github project execute?

The js in a js file under a project branch (gh-pages) on

github is not executed and can be run locally.
my github pages has a second-level domain name, so this project is accessed with second-level domain name / demo-name .

Code:

$(document).ready(function(){
        console.log("!");
            var date = new Date();
            var hour = date.getHours();
                if(hour==23||hour<7)
            {
                var aList=document.getElementsByClassName("archive-name");
                for(var i=0;i<aList.length;iPP){
                    document.getElementsByClassName("archive-name")[i].style.color="-sharpfff";
                }
                
            }else{
                var aList=document.getElementsByClassName("archive-name");
                for(var i=0;i<aList.length;iPP){
                    document.getElementsByClassName("archive-name")[i].style.color="-sharp333";
                }
            }
      }
The console in the

code doesn"t appear either. Why?
I don"t think it"s the code, so it"s github, but I didn"t find it.


your js code is all compressed into index.min.js, all console is removed by the compression tool, and naturally it is not printed out.


well, I found the reason
this is the difference between jquery's $(document). Ready () loading method and window.onload () problem
I've tested it myself in the project.

Link to an online article: address

Menu