简体   繁体   English

为什么我的JavaScript无法在GitHub Pages上运行?

[英]Why won't my JavaScript work on GitHub Pages?

After the events of this question I asked , where my CSS wasn't working on GitHub, I created a JavaScript file, and now that file isn't working. 在发生了这个问题之后, 我问了CSS在GitHub上不起作用的地方,我创建了一个JavaScript文件,现在该文件不起作用。

I have a button in the HTML, and when you click it, your unit of currency (right now: cookies; remember that this game is Sweet Shoppe) is supposed to go up, but nothing's happening when I click it. 我在HTML中有一个按钮,当您单击它时,您的货币单位(现在是:cookie;请记住,该游戏是Sweet Shoppe)应该会上升,但是当我单击它时什么也没有发生。

Here's the link to the repo one more time. 这是指向仓库链接 Can someone look at the JS file and see what's going wrong this time? 有人可以查看JS文件,看看这次出了什么问题吗?

Thanks. 谢谢。

Your HTML markup is incorrect: 您的HTML标记不正确:

<link href="js/main.js" type="text/javascript">

should be 应该

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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