Reputation: 1717
I have a Thymeleaf template with this piece of code
<a href="#" th:onclick="'performAjaxCall('@{/mymenupricesummary/pricealarm/1/{id}(id=${menuPriceSummary.menu.id})}');'">
But when I start the app I got this error:
Could not parse as expression: "javascript: ...
Upvotes: 0
Views: 484
Reputation: 20477
Yes, you need to format this correctly. This works for me:
<a href="#" th:onclick="'performAjaxCall(\'' + @{/mymenupricesummary/pricealarm/1/{id}(id=${menuPriceSummary.menu.id})} + '\');'">
Upvotes: 2