普通网友 2010-08-01 14:34
浏览 6
已采纳

JS / PHP:不警告错误

    <script type="text/javascript">
    $(function() {
  $("#continue").click(function () {
    $.ajax({
       type: "POST",
       url: "dbc.php?check=First",
    data: {full_name : $('#full_name').val(),
         usr_email : $('#usr_email').val()},

       success: function(msg){
            if(msg==1){
              $("#First_1").hide();
              $("#Next_2").toggle(); 
           }else{
              alert(msg);
           }         
        }
     });
     return false;
  });
}); 
    </script>

Here's dbc.php?check=First phpbin.net/x/249121011

if it´s receiving echo 1; from dbc.php?check=First, then hide & toggle, else then alert the output error.

Please check the link for the php, what is wrong here?

Right now i just get an empty alert.

  • 写回答

1条回答 默认 最新

  • douyonglang4845 2010-08-01 14:38
    关注

    $_POST['check'] is never set, thus your code isn't being called, thus nothing is output. Either remove the check for $_POST['check'] in your PHP script, add check: 'First' to the data property to the $.ajax call, or change $_POST to $_GET.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#wpf# devexpress的问题:选中时是黑色未选中是白色字体,想要更改未选中时字体的颜色(语言-c#)
  • ¥15 是莱克小黄人开始看胜利大利大利打开
  • ¥15 逐月累计,月份不连续,补齐月份
  • ¥15 应用简单的Python代码完成一个学生成绩管理系统
  • ¥15 用matlab求微分方程初值问题
  • ¥15 vscode下编写第三方库opencv与pcl代码时没有代码提示
  • ¥15 能够跑通不报错,如何解决?(标签-matlab)
  • ¥15 MOS在RDS较大,频率高时开关波形异常
  • ¥15 SCENIC分析报错求解答
  • ¥15 ceph初始化mon不成功 下图不报错 这个是什么元