How To Load JSON Data from Web Service in Ajax Url Property Datatables
How To Load JSON Data from Web Service in Ajax Url Property Datatables
I have problem when I try to load JSON Data from web service in ajax url. So far, I code this:
<script type="text/javascript">
$('#kategoriTable').dataTable({
ajax: {
url : "<? php echo 'http://localhost:90/kugi_deployment/api/json/reply/KategoriRetrieve'; ?>",
dataSrc : function(json) {
console.log(json);
return json.Kategoris
}
},
//data : testData.Kategoris,
columns: [
{ data: "KodeKategori"},
{ data: "Nama"},
{ data: "Definisi"},
{ data: "UnsurAbstrak"},
{ data: "Alias"},
{ data: "SumberDefinisi"},
{ data: "Tanggal"},
{ data: "TipeTanggal"},
{ data: "Edisi"},
{ data: "Role"},
{ data: "OtherCitationDetail"},
{ data: "NamaKatalog"},
{ data: "NamaOrganisasi"}
]
});
</script>
I got nothing to show in my data table. I think the problem is the URL property on AJAX. How can I fix this? Can anyone help me? Thanks