Thymeleaf: Refresh value with Ajax
问题 I have this piece of code in a Thymeleaf template. <div class="alert_counter" th:classappend="${numDeviceEventsWithAlarm>0} ? show_info"> <span th:text="${numDeviceEventsWithAlarm}">${numDeviceEventsWithAlarm}</span> </div> Is it possible to refresh the value numDeviceEventsWithAlarm using Ajax and without F5 ?? 回答1: You can use the feature to only render a fragment of the Thymeleaf view. First give the snippet of markup you want to update an id : <span id="eventCount" th:text="$