thymeleaf 接受字符串类型model值作为js方法参数报错500

Posted 旁光

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了thymeleaf 接受字符串类型model值作为js方法参数报错500相关的知识,希望对你有一定的参考价值。

旧   th:onclick="‘javascript:view_attendee_record_list(‘+${meetingMsg.getMeetingRecordAttendeeState()}+‘)‘"

 

html5的data-*能够为标签添加一些自定义的属性和值,借此来实现。

改为  <a href="#"  th:data-name="${meetingMsg.meetingId}" onclick="view_attendee_record_list(this.getAttribute(‘data-name‘))" >查看与会人员记录</a>

以上是关于thymeleaf 接受字符串类型model值作为js方法参数报错500的主要内容,如果未能解决你的问题,请参考以下文章

thymeleaf模板之href属性

thymeleaf模板之href属性

Thymeleaf前后端传值 页面取值与js取值

前端js函数中直接获取springmvc后台model中传值

thymeleaf在项目中的使用

thymeleaf在项目中的使用