在外部引入的.js檔案中無法使用Thymeleaf行內運算式嗎?
正常代碼:
<script th:inline="javascript">
$(function () {
var locale = /*[[${#locale}]]*/ "England";
alert("locale="+locale);
});
</script>
但是我把這段代碼單獨拿出到外部的.js檔案中,然后在html中引入該js檔案。
這是行內運算式不起作用了。
問題代碼:
<script th:src="https://bbs.csdn.net/topics/@{/static/pages/customer/customer_list.js}"></script>
customer_list.js
var locale = /*[[${#locale}]]*/ "England";
alert("locale="+locale);
根據Thymeleaf自己的檔案是可以這么使用的。(可能我理解錯了)
uj5u.com熱心網友回復:
https://www.baeldung.com/spring-thymeleaf-3uj5u.com熱心網友回復:
我英語不好,沒看懂具體怎么用轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/23645.html
標籤:HTML(CSS)
上一篇:關于.htaccess對網站欄目及其下面的文章重定向的問題,求解答
下一篇:easyUI凍結列設定
