저는 thymeleaf 및 spring에서 매우 새롭습니다. 사용중인 코드입니다. 이 자바 스크립트는 코드에서 작동하지 않습니다. 누군가가 문제가 될 것이라고 말해 줄 수 있습니까? 잘못된 참조를 사용하는 경우 수정하십시오.동적으로 만들 때 Thymeleaf 파일에서 Javascript가 작동하지 않습니다. 페이지
<script th:inline="javascript">
//<![CDATA[
// Javascript to enable link to tab
var hash = document.location.hash;
var prefix = "tab_";
if (hash) {
$('.nav-tabs a[href=' + hash.replace(prefix, "") + ']').tab('show');
}
// Change hash for page-reload
$('.nav-tabs a').on('shown', function(e) {
window.location.hash = e.target.hash.replace("#", "#" + prefix);
});
//]]>
</script>
<script th:inline="javascript">
//<![CDATA[
$("#example-advanced").treetable({ expandable: true });
// Highlight selected row
$("#example-advanced tbody").on("mousedown", "tr", function() {
$(".selected").not(this).removeClass("selected");
$(this).toggleClass("selected");
});
//]]>
</script>
정적 페이지에서 작동합니다. 그러나 역동적 일 때 예상대로 작동하지 않습니다. 그것을 둘러싼
예외를 제공해 주시겠습니까? –