如何修复Spring-boot应用程序jQuery无法正常工作?

时间:2019-10-01 16:14:13

标签: javascript jquery thymeleaf

我正在使用Thymelef编写一个Spring Boot应用程序。当我启动该应用程序时,我意识到尽管一切正常,但我的Javascript和Jquery并未呈现。所以我不确定是什么问题。我不确定是否有应用js代码的特殊方法。我不知道问题出在哪里。

 <!DOCTYPE html>
    <html xml="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
      <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta charset="ISO-8859-1">

        <title>Application</title>
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>

      </head>
      <body>

        <div class="container-fluid">
    <div class="row">
    <div class="col-md-12">
    <ul class="nav nav-tabs ">
    <li class="nav-item">
    <a class="nav-link active" href="#">Home</a>
    </li>
    <li class="nav-item">
    <a class="nav-link" href="create.html">Create</a>
    </li>
    <li class="nav-item dropdown ml-md-auto">
    <a class="nav-link dropdown-toggle" href="http://example.com" id="navbarDropdownMenuLink" data-toggle="dropdown">Account</a>
    <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownMenuLink">
    <a class="dropdown-item" href="#">Settings</a>
    <div class="dropdown-divider">
    </div> <a class="dropdown-item" href="#">Log out</a>
    </div>
    </li>
    </ul>
    </div>
    </div>

    <div class="row">
    <div class="col-md-12">
    <h3 class="text-center">
    App Mapping
    </h3>
    </div>
    </div>


    <div class="row" id="search-row">
    <div class="col-md-8">
    <div class="filter-search">
    <input class="form-control" id="myInput" type="text" placeholder="Search..">

    <div class="list-group" id="myList" th:each="plants : ${plants}">
    <a href="#" class="list-group-item list-group-item-action" th:text="${plants}"></a>

    </div>
    </div>
    </div>

    <div class="col-md-4">
    <span class="input-group-btn">
    <button type="button" class="btn btn-success">View</button>
    </span>
    </div>

    </div>

    </div>


    <script src="js/script.js"></script>
    <script src="js/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>

      </body>
    </html>

文件结构:


    .
    +-- static
       +-- js
        |   +-- bootstrap.min.js
        |   +-- jquery.min.js
        |   +-- popper.min.js
        |   +-- script.js

0 个答案:

没有答案