I use thymeleaf In a js function I create a row. Issue is the thymeleaf part is not interpreted so thymeleaf code is still in the code.
<script type="text/javascript" th:inline="javascript">
function addRow(tableId, letter){
var row=`
<tr>
<td data-id="${letter}">${letter}</td>
<td> <input class="" type="checkbox" name="compression"> </td>
/*[# sec:authorize="hasAnyRole('ROLE_ADMIN', 'ROLE_USER')"]*/
<td> <i class="fas fa-trash-alt delete"></i> </td>
/*[/]*/
</tr>
`;
...
}
</script>
Look like ` character cause issue with thymeleaf