<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<script type="text/javascript" th:inline="javascript">
console.log("Hello world");
</script>
<h1 th:text="${makeCodeName}"></h1>
</body>
</html>
นี่คือไฟล์ thymeleaf ของฉัน ฉันต้องการส่งคำขอ GET และเพิ่มปุ่มบางปุ่มลงในเพจเมื่อเพจโหลด แต่สคริปต์ของฉันไม่ต้องการทำงาน ฉันทำอะไรผิดที่นี่?
@CrossOrigin
@GetMapping("/makes/{makeCodeName}")
public String showCarModels(@PathVariable String makeCodeName, Model model){
model.addAttribute("makeCodeName", makeCodeName);
return "testMakes";
}
นี่คือวิธีที่ผมแสดงเพจ...
console.log
- person Ayrton   schedule 29.10.2019