jQuery验证后,$.ajax返回HTML源代码


after jquery validating, $.ajax return the html source code?

我在验证表单时遇到问题,字段被正确检查,但它返回当前的 html 源代码而不是"ctrl.php"中的值,换句话说,"成功集团"中的东西已经完成,但我从"ctrl.php"中没有得到任何东西,只返回 html 中的当前页面:(

知道吗?

$("#form_contest").validate({
    submitHandler: function(form){
        var email=$("#email").val();
        $.ajax({
            url: "ctrl.php",
            data:{name:$("#name").val(),email:email},
            success: function(data){
                alert(data); //data is the current source code??
                //other stuff after is okay
            }
        });
        return false;
    }
});

HTML表单:

<form id="form_contest" method="post">
  <input type="text" id="name" name="name" />
  <input type="text" id="email" name="email" />         
  <input type="submit" id="submit-contest" name="submit-contest" value="Enter" />
</form>

ctrl.php :

<?php
echo 1;
?>

页面 ctrl.php 无法访问,我有一个 nginx 规则将 404 错误重定向到主页。不容易找到..但这就是为什么Ajax总是给我主页源代码。