function getAllData(){ $.ajax({ url: "/getall", type: "get", contentType: 'application/json', dataType: 'json', success: function(response){ console.log(response) let data = response; $('#datatable tbody').empty(); $.each(response, function(index, item) { $('#datatable tbody').append( '' + '' + item.invNumber + '' + '' + item.nazvanie + '' + '' + item.raspologenie + '' + '' + item.numberved + '' + '' + item.buhnumberpp + '' + '' + item.kolichestvo + '' + '' + item.balancenumber + '' + '' ); }) }, }) } $(document).ready(function(){ getAllData() })