why datatables not display data but display loading after get API

why datatables not display data but display loading after get API

abdurahmanrizal13abdurahmanrizal13 Posts: 2Questions: 1Answers: 0

i mean to get data from url : http://cobakki.online/APInsp/public/api/rew_puni/status/1 but datatable not display data
below my code :

$('#example').DataTable({

        ajax: {
            url       : "http://cobakki.online/APInsp/public/api/rew_puni/status/1",
            dataSrc   : function(json){
                json = json.parse(json);
                return json.data;
            }
        },
        columns: [
            { "data": "id_pelanggaran" },
            { "data": "kode_pelanggaran" },
            { "data": "ket_pelanggaran" },
            { "data": "nilai" },
            { "data": "status" },
        ],

});

please help me, thanks

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.