thymeleaf a标签 执行 onclick 事件传参数 的写法:
<a href = "javascript:void(0)"
th:onclick = "|javascript : toDeleteUser( '${ user.id }' )|" >删除</a>
或者
<a href = "javascript:void(0)"
th:onclick = "'javascript : toDeleteUser(\'' + ${ user.id } + '\')'" >删除</a>
或者 用 button 标签:
<button class="btn btn-small btn-link" type="button"
th:onclick = "|javascript : toDeleteUser( '${ user.id }' )|" >删除</button>
传递两个参数,th:onclick 写成这样, = =
th:οnclick= "'javascript:goRead( \''+${item.id}+'\', \''+${cartoon.id}+'\' )'"