I am using Codeigniter 3 Wiredesignz HMVC plugin with Datatables. I can call the sAjax source correctly but the Ajax response has base_url () and the file path in it like this 'http://localhost/C:/xampp/htdocs/dcproduction/index.php/admin/datatable'.
My script in the view is like this
$(document).ready(function () {
var url = '<?php echo base_url(); ?>';
var oTable = $('#dt_customers').dataTable({
"bProcessing": true,
"bServerSide": true,
'type': 'POST',
"sAjaxSource": url+'admin/datatable/',
"oLanguage": {
"sProcessing": "<div class='dvLoading'><img src='<?php echo base_url(); ?>assets/img/ajax-loader.gif'></div>"
},
'fnServerData': function (sSource, aoData, fnCallback) {
//var csrf_value = '<?php //echo $this->security->get_csrf_hash(); ?>';
//aoData.push({name: 'csrf_test_name', value : csrf_value}); //csrf_test_name is defined in config/config.php
$.ajax
({
'dataType': 'json',
'type': 'POST',
'url': sSource,
'data': aoData,
'success':function(res){
alert(res);
},
'error':function(s){
alert(sSource);
}
});
}
});
});
How do I remove the file path 'C:/xampp/htdocs' from the request header?