AJAX does not make my request to the controller and returns not found


Good morning I have a problem since yesterday.

I have a JavaScript function where I make a request with AJAX to a controller called admin_controller to the create_session function.

function crear_sesion(){

                url : "<?php echo base_url(); ?>index.php/admin_controller/crear_sesion",
                type: "POST",
                data: $('#form_login').serialize(),
                dataType: "JSON",
                success: function(data){
                error: function (jqXHR, textStatus, errorThrown) {
                    alert('<?php echo base_url(); ?>index.php/admin_controller/crear_sesion');
                    var html = '';

                        html += '<div class="alert alert-danger"><i class="ti-user"></i> Usuario / Contrase単a incorrecta.'+
                                    '<button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">&times;</span> </button>'+


This is my driver where I return a TRUE

public function crear_sesion(){
    echo json_encode(array("status" => TRUE));

What happens is that it is not entering my controller and the AJAX error marks me not found, I already tried several things to track the problem but not yet logo to detect the failure, I already put the address directly in the AJAX url and also put it in the browser.

These are the errors that it shows me

I hope you can support me

asked by Javier fr 04.12.2018 в 18:09

0 answers