0
我做了一個非常簡單的列表與點擊第一個li
標籤顯示觸發一個js的功能,但它與錯誤抱怨:未捕獲的ReferenceError:getTodayRequest沒有定義(...)
Uncaught ReferenceError: getTodayRequest is not defined(…)
這裏代碼
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<script>
function getTodayRequest(){
console.log("here is today");
alert("here is today");
}
</script>
</head>
<body>
<div th:fragment="statistic_menu">
<div class="panel">
<div class="panel-body">
<div class="col-md-6 col-sm-12">
<h3 class="animated fadeInLeft">Statistic</h3>
<ul class="nav navbar-nav">
<li onclick="getTodayRequest()">Today</li>
</ul>
</div>
</div>
</div>
</div>
</body>
</html>
一切正確無誤 – cna327
@DineshSubhashPatil,爲什麼需要jQuery? –