I think you are looking for security by sending the ID by post, I show you 3 ways to do what you want (2 with get and 1 with post):
1st with get) instead of $ .ajax uses:
window.location.href = url + id;
// donde url sería: la url base + "controlador/add_cliente_view/id"
2nd with get) change in the controller
if ($this->input->is_ajax_request())
{
$id = $this->input->post('id');
redirect('controlador/add_cliente_view/'.$id); // por url
}
3ra) when wanting to get to a url with post, you must simulate a submit
// Esta función en javascript te ayudará a llegar a una url con POST simulado.
function post(url, parametros) { // parametros es json
var form = $('<form></form>');
form.attr("method", "post");
form.attr("action", url);
$.each(parametros, function(clave, valor) {
var campo = $('<input></input>');
campo.attr("type", "hidden");
campo.attr("name", clave);
campo.attr("value", valor);
form.append(campo);
});
$(document.body).append(form);
form.submit();
}
and to execute the function in javascript you write:
post(url + 'controlador/add_cliente_view', {id: id});
// url sería base_url(), no sé que tienes en url
Finally, where you got your problem, it would be useful for you in a div of your same page, you can load the form, but as you need to change url it would be these 3 forms
$.ajax({<br>
type: "POST",
url: url, <br>
data: {id: id},
}).done(function(data) {
$('#nombre_div').html(data);
});
See you