试图在 fnRowCallback 中运行函数。jQuery 报告此错误:
too much recursion
/js/jquery.js
Line: 4
找不到这个永无止境的循环。
alert(aData.toSource());
显示我试图循环遍历的数组。
var clientId = 1234;
var reportData = $('#report-data').dataTable({
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "?go=report&do=process&action=get-report",
"fnServerData": function ( sSource, aoData, fnCallback ) {
aoData.push({ "name": "client_id", "value": clientId });
$.getJSON( sSource, aoData, function (json) {
fnCallback(json);
});
},
"fnRowCallback": function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {
formatDates(nRow,aData);
},
});
function formatDates(nRow,aData) {
// alert(aData.toSource());
for(i=0; i!=aData.length; i++) {
if (aData[i].match(/^([0-9]{4}-[0-9]{2}-[0-9]{2})T([0-9]{2}:[0-9]{2}):[0-9]{2}\.[0-9]{3}$/gi)) {
reportData.fnUpdate('New Date Format', nRow['_DT_RowIndex'], i);
}
}
}