需要加入:
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
然后就可以使用
<input type="hidden" th:value="${error}" id="error"/>
在thymeleaf中怎么使用js获取到,后端传过来的值
<script th:inline="javascript" >
var eqp = [[${eqp}]]
</script>
a标签中使用
<a th:href="@{|appSingle?flag=${app['appId']}|}"></a>
本文介绍如何在Thymeleaf模板中使用JavaScript获取后端传递的数据,包括使用隐藏输入框存储错误信息、通过内联JavaScript获取对象数组,并展示如何在a标签中动态设置href属性。
2060

被折叠的 条评论
为什么被折叠?



