function CheckCodeInsert() {
        var code = $("#checkcode").val();
        $.ajax({
            url: "Ajax/CheckCodeInsert.aspx?Code=" + code,
            type: "GET",
            timeout: 30000,
            success: function() {
                var s = arguments[0];
                if (s == "1") {
                    //                $.ajax({
                    //                  url
                    //                    url: "/Ajax/CheckCodeInsert.aspx?Code=" + code,
                    //                });
                    alert("喔了");
                }
                else
                    ymPrompt.alert({ message: '验证码出错!', title: '系统提示', btn: [['确定', 'ok']], handler: null });
            }
        });    }它老是说          var s = arguments[0];
没有定义,难道在页面返回的出了用这个接受还有用哪个接收呢页面是这样
   if (String.Compare(Request.Cookies["CheckCode"].Value, checkcode.ToString().Trim(), true) != 0)
            {
                Response.Write(0);
                Response.End();            }
            else
            {
                Response.Write(1);
                Response.End();
            }

解决方案 »

  1.   

    用ashx页面,不要用aspx,aspx返回的东西,会把页面上的html,body等等都返回的,接收的时候会有问题。
      

  2.   

    function CheckCodeInsert() {
            var code = $("#checkcode").val();
            $.ajax({
                url: "Ajax/CheckCodeInsert.aspx?Code=" + code,
                type: "GET",
                timeout: 30000,
                success: function(data) {            
                    if (data == "1") {
                        //                $.ajax({
                        //                  url
                        //                    url: "/Ajax/CheckCodeInsert.aspx?Code=" + code,
                        //                });
                        alert("喔了");
                    }
                    else
                        ymPrompt.alert({ message: '验证码出错!', title: '系统提示', btn: [['确定', 'ok']], handler: null });
                }
            });    }