<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>股票历史数据</title>
<script th:src="@{jquery-3.4.1.min.js}"></script>
<script th:src="@{echarts.min.js}"></script>
</head>
<body>
<div id="container" style="width: 1300px;height: 600px;"></div>
<script>
//获取上下文参数
var baseUrl = [[${#request.getContextPath()}]];
</script>
</body>
</html>
- html标签中添加属性(xmlns:th=“http://www.thymeleaf.org”)
- 引入js文件( )
- 获取上线文参数( var baseUrl = [[${#request.getContextPath()}]];)