Ajax function with php is not working

0

I have this code plus ajax does not have a value

  $.ajax({

    url: 'php/vizCliente.class.php',
    type: 'POST',
     data: {
              update:      '1'
            },
    cache: false,
    datatype: "json",
    error: function(e) {
        alert('Erro ao tentar ação! \n'+e);
    },
    success: function(data) {
        alert(data);

    },
  });
});

This is the code in php

final class vizCliente
{

public $update;

public function __construct()
        {

                $this->update           = $_POST['update'];


                if($this->update == '1')
                {
                                    echo $this->update;                        

                }

        }
}
    
asked by anonymous 22.06.2017 / 02:59

1 answer

0

Your class is declared in vizCliente.class.php , however there is no instance of this class in this file, you must instantiate the class and fill in your values.

    
23.06.2017 / 16:56