Thymeleaf如何使⽤th:onclick给function传递参数
th:οnclick="⽅法名([[${后台数据1}]],[[${后台数据2}]],.......)"
th:οnclick="toTeacherEvaluateForm([[${Cid()}]],[[${classes}]],[[${Round()}]])"
function toTeacherEvaluateForm(cid, classes,round) {thymeleaf用法
console.log(cid)
console.log(classes)
console.log(round)
location.href = "toTeacherEvaluateForm?cid="+cid+"&classes="+classes+"&round="+round;
}
当然这⾥使⽤另⼀种也⽐较⽅便: th:href="@{/toTeacherEvaluateForm(cid=${Cid()},classes=${classes}, round=${Round()})}"

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。