From the posts I've read it doesn't seem possible to append/prepend a thymeleaf attribute using jquery such as the one below. But I'm wondering if there's any way around it. If so I'd be really grateful if you could specify how.
For example I have the below code but it isn't working because ThymeLeaf is compiled on the server while jquery is processed at the client.
Is there a way around this?
This is the code:
To elaborate on why I want to do this:
I have a table in a web application that displays the logged in users friends(left). The logged in user can add/remove friends by searching them in a search bar on the application. The below screenshot might help.
When a user searches for a friend in the right hand side search bar and adds them by clicking the heart icon I add a row to the table using jquery after acquiring the necessary data with ajax.
The problem is that this row contains thymeleaf attributes such as th:href. For example when the logged in user clicks on a friends name in the table it brings the user to the profile page of the friend.
However, thymeleaf attributes don't seem to work when appended/prepended with jquery in this way.
Would really appreciate some help.