Pass js variable as parameter in javascript section

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Pass js variable as parameter in javascript section

Horoshiy
Hi, everyone!
My code:
<script th:inline="javascript"> /*<![CDATA[*/ var number = 5; var result = [[${@teamService.getUser(number)}]]; /*]]>*/ </script>
number is always null :(
How I can pass number as parameter?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Pass js variable as parameter in javascript section

Metroids
There is no way to get something like that to work.

If you want to call java methods, you're going to have to use ajax and make some server side calls.
Loading...