How can i use for loop in javascript using thymeleaf?

后端 未结 3 1379
无人共我
无人共我 2021-01-13 16:09

I am using thymeleaf so when I run this application ,it gives me an error in (for(int i=0;i<10;i++) It means I have to respect the syntaxe of thymeleaf.My question is how

3条回答
  •  庸人自扰
    2021-01-13 16:53

    You should wrap your script in this structure :

    
    

    EDIT :

    Don't forget to store your javascript and other static files in the /src/main/webapp folder of your spring-boot project

    EDIT2 :

    You can do directly your script with thymeleaf :

    
        
        
        
        
    
    

提交回复
热议问题