Getting jQuery is undefined error in datatables 1.10.2 version was working in a previous version
Getting jQuery is undefined error in datatables 1.10.2 version was working in a previous version
karthik0328
Posts: 1Questions: 1Answers: 0
function renderTable(result) {
var dtData = [];
$.each(result.colPolicyDocs, function () {
dtData.push([
this.sEDMSContentId,
this.sFileType,
this.dtDateCreated
]);
});
$('#grid').dataTable({ //grid is the id of the table
'aaData': dtData,
'bPaginate': true,
'bInfo': false,
'bFilter': false
});
}
$(document).ready(function () {
BindData();
});
function GetAllData() {
BindData();
}
function BindData() {
$.ajax({
type: "POST",
url: '<%= ResolveUrl("Temp.svc/GetData") %>',
data: '{"sDocType":"Sample"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
renderTable(response.d);
},
failure: function (errMsg) {
$('#errorMessage').text(errMsg); //errorMessage is id of the div
}
});
}
The service is an AJAX enabled web service which returns the data however getting an error when trying to run it as
Microsoft JScript runtime error: 'jQuery' is undefined. This works fine with the 1.4.0.0 version of the datables library.
This discussion has been closed.
Answers
We'd need a link to a page showing the error, as required in the forum rules, to be able to say what is going wrong.
Allan