简体   繁体   中英

Javascript not running on github, but runs on local machine

I uploaded a project page on Github, but the page is not executing the javascript that works properly on a local machine.

Link to my github: https://lydiatest.github.io/

The sidebar menu and the header should carry the effect as of below:

https://codepen.io/mrReiha/pen/

All javascripts are located in the file index.js:

https://lydiatest.github.io/dats6401/js/index.js

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

Thank you for any help!

The issue is not with your script. It is with jquery not getting loaded due to url getting served from http instead of https .

Your script depends on jquery (which failed to download) and hence fails to run. You can check the console of your browser for further details.

Update http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js to https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js and it should work fine.

Hope it helps. Revert for any doubts.

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