Dear sirs,
I would like to include javascript external files into my Thymeleaf template, and use localized strings inside the javascript file.
I can't understand why it is not evaluated.
In HTML
<script th:inline="javascript" th:src="@{/js/xxxx.js}"
In Javascript file
/*<![CDATA[*/
function showCode() {
//var code = /*[[${code}]]*/ '12345';
var code = /*[[#messages.msg('form.description')]]*/ 'descr';
document.getElementById('code').innerHTML = code;
}
/*]]>*/
Please help
Open in new window
( from https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html )