Thymeleaf
Controller에서 받아 온 변수 값 JavaScript에서 쓰는 법
제뉴어리맨
2021. 2. 27. 01:05
<script th:inline="javascript"> /* 상단 html 태그에 xmlns:th="http://www.thymeleaf.org" 추가하면 inline 태그는 안 넣어도 되는듯하다.. */
document.write([[${dto.seq}]]+" 출력 "); /* 데이터와 문자열을 연결하여 출력 */
document.write([[${dataList[0]}]]); /* 리스트의 경우 */
</script>