I use spring mvc and thymeleaf and I received model object, so I have something like that :
<li th:each="game : ${availableGames}">
<a class="gameLink" href="#" th:text="${game.getId()}" th:object="${game}"/>
</li>
How to use this object in ajax and send it to controller ? I tried this
var ob = $(this).object()
data : JSON.stringify(ob.JSON()),
contentType: 'application/json',
but it isn't working