【发布时间】:2021-07-19 14:27:56
【问题描述】:
谁能告诉我为什么 javascript 可以在 localhost 上运行,但是当使用 github Pages 或 vercel 时,javascript 会停止?
github上的代码:https://github.com/Marincor/Bx-Bank
部署github页面:https://marincor.github.io/Bx-Bank/
在 Vercel 上部署:https://bx-bank.vercel.app/
当我转到页面 index.html 和 cadastro.html 的开发工具源时,它们没有我链接的 JS 文件夹。
print of devTools chrome sourcers tab
print of the script src inside the html file
我不知道该怎么办,有什么建议吗?
由于某种原因,home.html 可以使用 javascript 文件,而 index.html 和 cadastro.html 不能。
【问题讨论】:
-
请不要要求我们调试您的 github 存储库。而是编辑问题并向其添加minimal reproducible example。
-
可能是因为在 GitHub 上它是区分大小写的。
-
我在问题中添加了一些案例的打印件,有帮助吗?
-
丝网印刷不是minimal reproducible example。我们无法运行它,也无法从中复制/粘贴。
标签: javascript deployment web-deployment github-pages vercel