1. 程式人生 > >thymeleaf的繫結click事件

thymeleaf的繫結click事件

最近在學習spring boot ,因為spring boot 的前端模板預設推薦thyme leaf,所以也開了一下 thyme leaf繫結button的onclick事件

<input type="button" th:onclick="'javascript:fungetone(\''+${con.uid}+'\');'" value = "修改" />
function fungetone(uid){
			$.post('/consumer/getone',{"uid":uid},function(data){
				。。。。。。。。
			
		}

關鍵在於onclick後面的拼接,注意單引號和雙引號的區別!!!