.commy Ajax调用在我的域中不起作用

时间:2015-04-11 03:34:31

标签: jquery ajax

这是我的代码。
我认为我的道路有误 这是我第一次将AJAX放入域名中......

    $.ajax({
            url: 'http://www.komatpillar.com/ajax/check_email.php',
            type: 'POST',
            data: {pass_email_address : email_address},
            dataType: 'json',
            success: function(result) {
                var res = result.user_id;
                if(res > 0){

                    $('#message_email').focus(); 
                    window.scrollTo(0, 540);
                    $('#danger_container_email').attr('class', 'alert alert-danger');
                    $('#message_email').html('This email address is already existing!');
                    $('#register').attr('disabled','disabled');
                    $('#register').removeAttr('name');
                    $('#message').css('color', 'red');
                    $('#success_email').attr('class','form-group has-error has-feedback');
                    $('#email_glyp').attr('class', 'glyphicon glyphicon-remove form-control-feedback');


                    }else{
                            $('#danger_container_email').removeAttr('class');
                            $('#message_email').html('');
                            $('#success_email').attr('class','row form-group has-success has-feedback');
                            $('#email_glyp').attr('class', 'glyphicon glyphicon-ok form-control-feedback');
                            $('#register').removeAttr('disabled');
                            $('#register').attr('name','cmd_add_new_user');

                        }

以下是其余部分。

1 个答案:

答案 0 :(得分:-1)

改变这个:

  data: {pass_email_address : email_address},

到此:

  data: "{pass_email_address:'" + email_address + "'}",