簡體   English   中英

由於未知原因,JavaScript 未與網頁連接

[英]JavaScript is not connecting with web page for unkown reason

我提出了一個問題,我正在處理我已經工作了大約 6 個小時但一直無法找到解決方案的事情。 我的 HTML 代碼是:

<!DOCTYPE html>
<html>
  <head>

    <title>Chore Door!</title>
    <link href="resources/css/styles.css" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Work+Sans" rel="stylesheet" type="text/css">

  </head>

  <body>
    <div class="header">
      <img src="resources/images/logo.svg"/>
    </div>
    <div class='title-row'>
      <table>
        <tr>
          <td class="instructions-number">1</td>
          <td class="instructions-text">Hiding behind one of these doors is the ChoreBot</td>
        </tr>
        <tr>
          <td class="instructions-number">2</td>
          <td class="instructions-text">Your mission is to open all of the doors without running into the ChoreBot.</td>
        </tr>
        <tr>
          <td class="instructions-number">3</td>
          <td class="instructions-text">If you manage to avoid the ChoreBot until you open the very last door, you win!</td>
        </tr>
        <tr>
          <td class="instructions-number">4</td>
          <td class="instructions-text">See if you can score a winning streak!</td>
        </tr>
      </table>
      <img src="resources/images/Star.svg"/>
      <p class="instructions-title">Instructions</p>
      <img src="resources/images/Star.svg"/>
    </div>
    <div class="door-row">
      <img id='door1' class="door-frame" src="resources/images/closed_door.svg"/>
      <img id='door2' class="door-frame" src="resources/images/closed_door.svg"/>
      <img id='door3' class="door-frame" src="resources/images/closed_door.svg"/>
    </div>
    <div id="start" class="start-row">Good luck!</div>
    <script src="./script.js" type="text/javascript"></script>
  </body>
</html>

由於 JavaScript 文件的鏈接,我將在 GitHub 上的存儲庫中進行直播: Text

任何幫助將不勝感激。 我已經使用 JavaScript 大約 3 周了。

謝謝

查看控制台日志。

該文件連接正常,只是文件中有錯誤,因此代碼未正確運行。

類型錯誤:Math.Floor 不是函數

方法的名稱是floor小寫)而不是Floor

因此,將Math.Floor更改為Math.floor ,它應該可以正常工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM