Home > front end >  In the external. Js file used in Thymeleaf inline expression
In the external. Js file used in Thymeleaf inline expression

Time:12-05

. Introduced in the external js file cannot be used in Thymeleaf inline expression?

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-3

CodePudding user response:

I didn't understand English is not good, specific how to do

CodePudding 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 executed
1

2

3

4
  • Related