I am trying to show my ajax json response into data table. I am using datatable AJAX option but nothing is working.
$(document).ready(function() {
$('#example').dataTable( {
"ajax": {
"url": "https://2057-185-202-239-227.ngrok.io/serviceprovider/billByServiceProvider",
"contentType": "application/json",
"type": "POST",
"data": function ( d ) {
return JSON.stringify( d.serviceProvider = sessionStorage.getItem("Services_id") );
},
"dataSrc": function(json){
console.log(json);
}
}
});
});
Thanks in advance for help :)