我有一个很大的问题列表,试图让我的数据表可编辑,所以我想检查我的脚本是否兼容。
<div th:replace="fragments/partial :: partialJs"></div>
<div th:replace="fragments/withEasy :: js"></div>
<script type="text/javascript"
src="../../resources/js/jquery-1.11.3.min.js"
th:src="@{/resources/js/jquery-1.11.3.min.js}"></script>
<script type="text/javascript" src="https://cdn.datatables.net/r/dt/jqc-1.11.3,dt-1.10.8/datatables.min.js" ></script>
<script type="text/javascript"
src="../../resources/js/plugins/dataTables/jquery.dataTables.editable.js"
th:src="@{/resources/js/plugins/dataTables/jquery.dataTables.editable.js}"></script> // ver 2.3.3.
<script type="text/javascript"
src="../../resources/js/plugins/dataTables/jquery.dataTables.js"
th:src="@{/resources/js/plugins/dataTables/jquery.dataTables.js}"></script> //ver 1.10.0
<script type="text/javascript"
src="../../resources/js/jquery.jeditable.js"
th:src="@{/resources/js/jquery.jeditable.js}"></script>
// Version 1.7.3
<script type="text/javascript"
src="../../resources/js/jquery.validate.min.js"
th:src="@{/resources/js/jquery.validate.min.js}"></script> //v1.13.1
答案 0 :(得分:0)
你正在加载jQuery两次,第二次来自cdn.datatables.net
。使用没有嵌入jQuery的链接,即https://cdn.datatables.net/r/dt/dt-1.10.8/datatables.min.js
此外,您正在加载DataTables脚本两次,首先来自cdn.datatables.net
,然后是本地../../resources/js/plugins/dataTables/jquery.dataTables.js
。删除../../resources/js/plugins/dataTables/jquery.dataTables.js
,
Aslo jquery.jeditable.js
需要在jquery.dataTables.editable.js
之前加载。