I want to use Thymeleaf in JavaScript code

Asked 2 years ago, Updated 2 years ago, 107 views

I would like to use Thymeleaf in the JavaScript code in HTML.
The source code is as follows:
More specifically, "${i}" is specified in Thymeleaf, so
I would like to refer to the contents of the "i" variable as value.

<a href="javascript:document.f.page.th:value="${i}"; document.f.submit();">

Please give me some advice.

javascript java html spring

2022-09-30 10:52

1 Answers

Somehow, I can understand how you feel, but I can't answer well because I don't understand the situation.Why don't you check the following areas?

  • Doesn't this javascript have the form element of? The correct answer may change depending on how you write the input tag.
  • In
  • :value, is :.?
  • Isn't
  • "${i}" '${i}'?" causes attribute values to be truncated in the middle.


2022-09-30 10:52

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.