I am new to this forum and I want to request help with a problem that I have, messages that appear in the console and datatable does not show the data in the table, I will describe: the problem.
Uncaught TypeError: Cannot read properties of undefined (reading 'length')
at jquery.dataTables.min.js:4:32902
at Object.e [as success] (jquery.dataTables.min.js:4:25769)
at c (jquery-3.6.4.min.js:2:28447)
at Object.fireWith [as resolveWith] (jquery-3.6.4.min.js:2:29192)
at l (jquery-3.6.4.min.js:2:80176)
at XMLHttpRequest.<anonymous> (jquery-3.6.4.min.js:2:82630)
this is my js code
let tblAdmins;
document.addEventListener("DOMContentLoaded", function(){
tblAdmins = $('#tblAdmins').DataTable({
ajax: {
url: base_url + "/Admin/listar",
dataScr: ""
},
columns: [
{"data" : "id"},
{"data" : "usuario"},
{"data" : "nombre"},
{"data" : "clave"},
{"data" : "estado"},
]
});
})
this is my table
Id | Usuario | Nombre | Clave | Estado |
---|