$(document).ready(function () { tampil_data_item(); $('#table_dhmd').DataTable(); function tampil_data_item() { $.ajax({ type: 'ajax', url: window.location.origin + '/admin/get_dhmd', async: false, dataType: 'json', success: function (data) { var html = ''; var i; var base_url = window.location.origin; for (i = 0; i < data.length; i++) { html += '' + '' + (i + 1) + '' + '' + data[i].nama_dosen + '' + '' + data[i].fakultas + '' + '' + data[i].prodi + '' + '' + data[i].matkul + '' + ''; } $('#show_data').html(html); } }); } });