Thymeleaf:在javascript块

时间:2018-02-16 13:19:07

标签: javascript thymeleaf

在thymeleaf html temlate上,我尝试在js中执行简单的for循环

<script type="text/javascript" th:inline="javascript">
var data = [[${dataGraph}]];
for(var i = 0; i < data.length ; i++){
  * * *
  some code
  * * * 
}
</script>

当我启动应用程序并转到此模板时,服务器返回

[THYMELEAF][http-nio-127.0.0.1-8080-exec-8] Fatal error during parsing org.xml.sax.SAXParseException: 
The content of elements must consist of well-formed character data or markup.
Exception processing template "admin/home": Exception parsing document: template="admin/home", line 206 - column 23

第206行第23栏 - 它是我上面写的for循环。

这个for循环有什么问题?

0 个答案:

没有答案
相关问题