$(document).ready(function () { tampil_data_item(); $('#table_dosen').DataTable(); function tampil_data_item() { $.ajax({ type: 'ajax', url: window.location.origin + '/admin/get_dosen', 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 += '