【问题标题】:Files not loading properly from github host文件无法从 github 主机正确加载
【发布时间】:2019-08-25 05:22:48
【问题描述】:

我试图让我的计算器网站通过 github.com (https://codingoni.github.io/bCalculator/) 工作 当我从本地存储打开我的索引文件时,它可以工作,但是当我尝试访问网站时,它只会显示

bCalculator 我假设 css 和 javascript 没有加载,但我不知道为什么。

我已尝试更改目录

    <link rel="stylesheet" type="text/css" href="./calc.css">
    <script src="./calc.js"></script>

文件名称正确。

【问题讨论】:

    标签: javascript html css github hosting


    【解决方案1】:

    查看路线: 您没有index.html 文件,因此当您请求https://codingoni.github.io/bCalculator/ 时,GitHub 正在读取README.md,但是当您通过https://codingoni.github.io/bCalculator/calc.html 访问它时它工作正常。

    【讨论】:

    • 谢谢!我应该将我的主文件更改为 index.html 还是应该更改 github.com 上的 url
    • @CodingOni 我会将其更改为 index.html - 如果它解决了您的问题,请将答案标记为解决方案。
    猜你喜欢
    • 1970-01-01
    • 2023-01-27
    • 2013-09-04
    • 2016-02-24
    • 2017-01-07
    • 1970-01-01
    • 2012-09-24
    • 2017-11-17
    • 2022-12-03
    相关资源
    最近更新 更多