0

我可以在本地运行我的代码。一切似乎都很完美。但是,一旦我将存储库上传到 Git-Hub 并尝试使用 Git-hub 页面运行它,部分网站会中断吗?具体来说,唯一的问题是当我单击导航栏上的“添加到库”时应该运行的模式。

我尝试将其从 Git-Hub 中删除并重新上传。我试过移动文件,但似乎没有任何效果。我真的不确定问题的根源是什么(?)

<!-- Button trigger modal -->
            <button
              type="button"
              class="btn btn-secondary"
              data-toggle="modal"
              data-target="#libraryModal"
            >
              Add to Library
            </button>

<!-- Modal -->
    <div
      class="modal"
      id="libraryModal"
      tabindex="-1"
      role="dialog"
      aria-labelledby="libraryModalLabel"
      aria-hidden="true"
    >
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header">
            <h5 class="modal-title text-primary" id="libraryModalLabel">
              Add to Library
            </h5>
            <button
              type="button"
              class="close"
              data-dismiss="modal"
              aria-label="Close"
            >
              <span aria-hidden="true">×</span>
            </button>
          </div>
          <div class="modal-body">
            <form>
              <div class="form-group">
                <input
                  type="text"
                  class="form-control mb-2"
                  id="englishField"
                  placeholder="English"
                />
                <input
                  type="text"
                  class="form-control"
                  id="spanishField"
                  placeholder="Spanish"
                />
              </div>
            </form>
          </div>

          <div class="modal-footer">
            <button type="button" class="btn btn-primary" id="addWord">
              Add Word
            </button>
            <button type="button" class="btn btn-primary" id="addPhrase">
              Add Phrase
            </button>
          </div>
        </div>
      </div>
    </div>

预期:它将打开一个带有两个文本框和两个按钮的模式。实际:https ://at-lowdesu.github.io/EstudiarEspanol/#study-inner (它没有打开。)

Git-Hub 链接:https ://github.com/At-LowDeSu/EstudiarEspanol

4

4 回答 4

1

You have a mixed content error. All src should link to https://.. but you have one with http://

<script
      src="http://code.jquery.com/jquery-3.4.1.min.js"
      integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
      crossorigin="anonymous"
    ></script>

Replace http://code.jquery.com/jquery-3.4.1.min.js with https://code.jquery.com/jquery-3.4.1.min.js

于 2019-08-22T01:55:33.027 回答
0

引导模式:

https://www.w3schools.com/bootstrap/bootstrap_modal.asp

您可以参考模态的更多示例。

于 2019-08-29T10:44:05.667 回答
0

我能够通过更改 jQuery 脚本调用来修复它。

<script
      src="//code.jquery.com/jquery-3.4.1.min.js"
      integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
      crossorigin="anonymous"
    ></script>
于 2019-08-22T01:55:26.593 回答
0
于 2019-08-22T01:46:03.867 回答