gpt4 book ai didi

java - jquery datatables 未定义不是一个函数

转载 作者:太空宇宙 更新时间:2023-11-04 14:10:53 25 4
gpt4 key购买 nike

我当前使用数据表提供的 Ajax 函数,我仅将 url 更改为我自己的 url 和列数。这是我得到的错误

Error未捕获的类型错误:未定义不是函数 $(document).ready(function() {
alert('working');
$('#example').dataTable( {
"processing": true,
"serverSide": false,
"ajax": {
"url": "ViewOwnConsultServ",
"type": "POST"
},
"columns" :
[
{"data" : "lecturename"},
{"data" : "date"},
{"data" : "starttime"},
{"data" : "endtime"},
{"data" : "school"} ,
{"data" : "team"} ,
{"data" : "status"} ,
{"data" : "problem"}
]
} );
} );
这是我的 HTML

<table id="example" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Lecturer's Name</th>
<th>Date</th>
<th>Start Time</th>
<th>End Time</th>
<th>School</th>
<th>Team</th>
<th>Status</th>
<th>Teacher's note</th>
</tr>
</thead>
</table>

我怀疑这与我的 json 有关,但我检查了。下面显示了我的 servlet 的示例。数据表列是否应该 == 我的 json 字符串的参数数量?

Servlet json

最后这是我的 json 输出的示例

"data":[{"id":0,"staffid":0,"lecturename":"","starttime":"1pm","endtime":"2pm","roomno":0,"school":"Northland Secondary School","team":"northland","status":"Unconfirmed","date":"01/19/2015","problem":" can i PLEASE CONSULT YOU ON MATTER THAT DONT EXIST"},

哦,我忘了这是我的进口

imports

最佳答案

scripts 避免重复脚本对我有用,因为我使用某些 js 脚本重新添加到黑色 jsp 页面中。因为我没有意识到页面底部还有其他脚本

关于java - jquery datatables 未定义不是一个函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28336651/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com