$(document).ready(function(){
    if ( $.fn.dataTable.isDataTable( '#list_clientes' ) ) {
        table = $('#list_clientes').DataTable();
        table.destroy();
        $.ajax({
            url: 'back-end/clientes.php',
            type: 'GET',
            success: function(response){
            let o = JSON.parse(response);;
                $('#list_clientes').dataTable( {
                    retrieve: true,
                    data : o,
                    columns: [
                        {"data" : "codigo"}, 
                        {"data" : "nombre"},
                        {"data" : "telefono"},
                        {"data" : "email"},
                        {"data" : "guias"}                             
                    ],
                    "language": {
                        url: "lib/js/es.json"
                    }
                });
            
            }
        })
    }else{
        $.ajax({
            url: 'back-end/clientes.php',
            type: 'GET',
            success: function(response){
            let o = JSON.parse(response);;
                $('#list_clientes').dataTable( {
                    retrieve: true,
                    data : o,
                    columns: [
                        {"data" : "codigo"}, 
                        {"data" : "nombre"},
                        {"data" : "telefono"},
                        {"data" : "email"},
                        {"data" : "guias"}                             
                    ],
                    "language": {
                        url: "lib/js/es.json"
                    }
                });
            
            }
        })
    }
})