jquery 数据表未定义不是函数
jquery datatables undefined is not a function
我目前正在使用数据表提供的 Ajax 函数,我只将 url 更改为我自己的 url 和列数。这是我得到的错误
未捕获的类型错误:未定义不是函数
$(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 字符串的参数数量?
最后这是我的 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"},
哦我忘了这是我的进口商品
避免重复脚本对我有用,因为我使用某些 js 脚本重新添加到黑色 jsp 页面。因为我没有意识到页面底部还有其他脚本
我目前正在使用数据表提供的 Ajax 函数,我只将 url 更改为我自己的 url 和列数。这是我得到的错误
$(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 字符串的参数数量?
最后这是我的 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"},
哦我忘了这是我的进口商品