PHP MVC的jQuery的ajax

Im beginner and have just simple PHP MVC for JQUERY SPA, and just wonnt to use Jquery Ajax to index.php, like front controller calling RouterControler and class AjaxKontroler with registruj() method...using user model to add new user to MySQL..

 class AjaxKontroler
{
    public function registrovat()
    {       

        if ($_POST)
        {
            try
            {

                $spravceUzivatelu = new SpravceUzivatelu();
                $spravceUzivatelu->registruj($_POST['email'],$_POST['heslo'],$_POST['hesloZnovu'],$_POST['jmeno'],$_POST['prijmeni'],$_POST['telefon'],$_POST['ulice'],$_POST['mesto'],$_POST['psc'],$_POST['captcha']);
                $spravceUzivatelu->prihlas($_POST['email'], $_POST['heslo']);               

            }
            catch (ChybaUzivatele $chyba)
            {
                $this->pridejZpravu($chyba->getMessage());
            }
        }
    echo "Registrace proběhla úspěšně"; 
    }

Singup form:

$("#dokoncitregistraci").click(function () {
    var email = $("#emailreg").val();

    var heslo = $("#hesloreg").val();
    var hesloznovu = $("#hesloznovureg").val();
    var jmeno = $("#jmenoreg").val();
    var prijmeni = $("#prijmenireg").val();
    var telefon = $("#telefonreg").val();
    var ulice = $("#ulicereg").val();
    var mesto = $("#mestoreg").val();
    var psc = $("#pscreg").val();
    var captcha = $("#captcha").val();

    console.log("jedu");
    $.ajax({
        type: "POST",
        url: "../ajax/registrovat",
        data: { 
        "email" : email,
        "heslo": heslo,
        "hesloznovu" : hesloznovu,
        "jmeno" :jmeno ,
        "prijmeni":prijmeni,
        "telefon":telefon,
        "ulice":ulice,
        "mesto" :mesto,
        "psc" : psc,
        "captcha" :captcha
        },
        dataType: "JSON",
        success: function(msg){
            alert("msg");

            }

But all signup inputs are correctly add ti MySQL like new row. I have no success response to work with. Are there some trick to use success response in MVC?

Browser just doesn't make any JS alert(). Sorry abeout using StackOwerflow, its my first question here ane no best practise for it:)

Your code looks fine overall. As far as I know, you don't need the double quotes in "email":email. It can be email:email, but that shouldn't be the problem.

My instinct tells me to double check your ajax url:. Relative urls are tricky, as you have to make them relative to the page running the execution, not what the browser shows. I'd switch to absolute urls like http://www.example.com/ajax/registrovat/ until you are certain what the problem is. The last slash after registrovat is important for differentiating between a controller name and a value.

You can also add an error: function() {} to get more information about what is going on.