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
![arnoldgultom](https://secure.gravatar.com/avatar/da85c9f1e641efb987209e3f21f4dec7/?default=https%3A%2F%2Fvanillicon.com%2Fda85c9f1e641efb987209e3f21f4dec7_200.png&rating=g&size=120)
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