为什么我的jQuery不起作用?

时间:2015-12-11 13:06:14

标签: javascript jquery html css

我一直试图在我的HTML,jquery甚至CSS中找到一个错误,这会阻止我的jQuery甚至加载,但无济于事。任何帮助表示赞赏

代码

$(document).ready(function() {
  'use strict';
  $("#IndexContent").hide();
  $("#BidListMainMenu").mouseenter(function() {
    $(this).slideToggle();
  });
  $("Table").mouseleave(function() {
    $(this).slideToggle();
  });
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!DOCTYPE html>

<html>

<head>
  <link rel="stylesheet" type="text/css" href="StyleSheet.css">
  <script src="code.jquery.com/jquery-1.11.3.min.js"></script>
  <script type="text/javascript" src="jQuery.js"></script>
  <title>Main Menu</title>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<div id="IndexBackgroundImage"></div>

<body id="Index">
  <div id="IndexLogoDiv">
    <img src="images/logo.gif" alt="Logo" />
  </div>

  <center>

    <div id="IndexContent">

      <h1>Intranet</h1>

      <table>
        <tbody>
          <tr>
            <td class="mainButton">
              <img alt="Bid List" src="images/IndexBidList.png" />
            </td>
          </tr>
          <div id="BidListMainMenu">
            <td>
              <table>
                <tbody>
                  <tr>
                    <td colspan="1">
                      <a href="BidList/CurrentBid.php">
                        <img alt="Bid List alteration" src="images/BidList.png" />
                      </a>
                    </td>
                  </tr>
                  <tr>
                    <td colspan="1">
                      <a href="Bidlist/NewProject.php">
                        <img alt="Add New Project" src="images/AddNewProject.png" />
                      </a>
                    </td>
                  </tr>
                  <tr>
                    <td colspan="1">
                      <a href="BidList/EditProject.php">
                        <img alt="Edit Project" src="images/EditProject.png" />
                      </a>
                    </td>
                  </tr>
                  <tr>
                    <td colspan="1">
                      <a href="BidList/Priorities.php">
                        <img alt="Priorities" src="images/SetPriorities.png" />
                    </td>
                  </tr>
                  <tr>
                    <td colspan="1">
                      <a href="BidList/Maintenence.php">
                        <img alt="Edit Project" src="images/Maintenence.png" />
                      </a>
                    </td>
                  </tr>
                </tbody>
              </table>
            </td>
          </div>
          <tr>
            <td>
              <img alt="Bid List alteration" src="images/IndexMaintenence.png" />
            </td>
          </tr>
          <tr>
            <td>
              <a href="">
                <img alt="Wordpress Page" src="images/IndexWordpress.png" />
            </td>
          </tr>
        </tbody>
      </table>
    </div>
    <div id="IndexFooterDiv">
      <img src="images/address.gif" alt="Address" />
    </div>
  </center>
</body>

</html>

没有证据表明jQuery甚至可以启动,这是不寻常的,因为它是链接的,我导入了库。如果它有用,我可以发布CSS。我在那里放了第一个$("#IndexContent").hide()测试用例来检查它是否已加载。但没有任何效果。感谢任何帮助,谢谢。

3 个答案:

答案 0 :(得分:4)

GROUP BY

应该是:

<script src="code.jquery.com/jquery-1.11.3.min.js"></script>

答案 1 :(得分:3)

bindParam来源的src属性错误:

cdn

应该是:

src="code.jquery.com/jquery-1.11.3.min.js"

你有一个错字:

src="//code.jquery.com/jquery-1.11.3.min.js"  // will look https || http

答案 2 :(得分:1)

首先,我会将html <script src = >更改为

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>

之后,你输入了

$(Document).ready(function () {});

Document更改为document