Normal code:
<script th: inline="javascript" & gt;
$(function () {
Var locale=/* [${# locale} []] */"England";
Alert (" locale="+ locale);
});
</script>
But I put this code in a separate out to the external. Js file, and then the js file, introduced in HTML,
This is an inline expressions do not work,
The problem code:
<script th: SRC="https://bbs.csdn.net/topics/@ {/static/pages/customer/customer_list js}" & gt; </script>
Customer_list. Js
Var locale=/* [${# locale} []] */"England";
Alert (" locale="+ locale);
According to the Thymeleaf own documents can be so used, (maybe I'm wrong)
CodePudding user response:
https://www.baeldung.com/spring-thymeleaf-3CodePudding user response:
I didn't understand English is not good, specific how to doCodePudding user response:
Brother, this problem is solved, I also is through the introduction of external js, but written in external js thymeleaf don't seem to be executed1
2
3
4