没有错误,但没有数据。 是否有我需要添加,使这项工作的选项? 我的数据使用来自Ajax调用的结果。
有什么建议么?
码:
$.ajax({
cache: false,
url: "http://a.co.nz/GetTestDocs",
data: '{'
+ ' "oldCompanyIdString": "' + selectOldCompanyId + '", '
+ ' "effectiveDateString": "' + selectEffectiveDate + '", '
+ ' "endDateString": "' + selectEndDate + '",'
+ ' "userToken": "' + userToken + '"'
+ ' }',
type: "POST",
//jsonpCallback: "Value",
contentType: "application/json",
dataType: "json",
error: function (jqXHR, textStatus, errprThrown) {
//console.log(errprThrown);
//window.location = location;
},
success: function (value) {
if (value.GetTestDocsResult != null) {
result = $.parseJSON(value.GetTestDocsResult);
if (result.length == 0) {
alert("Your query did not return any data.");
}
else {
console.log(result);
bindDataTable(result.DocsList);
}
}
}
});
function bindDataTable(data) {
$('#docuList').dataTable({
"processing": true,
"ajax": data,
"columns": [
{ "data": "Description" },
{ "data": "FileLocation" }]
});
}
帮助pls..my第一次使用数据表