Jquery ajax does not work on mobile device only works on desktop version

Asked

Viewed 265 times

1

To in the following situation, my login form is working perfectly in desktop version, I went to test on android and Ios it does not work and not even an error on the console... just waiting for the answer of the api.. follow my javascript file

$(function() {

    $("#login-form").validate({

        rules : {
            email : {
                required : true,
                email : true
            },
            password : {
                required : true,
                minlength : 0,
                maxlength : 20
            }
        },

        messages : {
            email : {
                required : 'E-mail do game',
                email : 'E-mail do gmae não e valido'
            },
            password : {
                required : 'Senha do game'
            }
        },
        submitHandler: submitForm
    });

    function submitForm()
    {
        var data = $("#login-form").serialize();
        $.ajax({

            type : 'POST', 
            url  : 'http://localhost/api.game/api/auth',
            data : data,

            beforeSend: function()
            {
                $("#error").fadeOut();
                $("#btn-login").html('<span class="glyphicon glyphicon-transfer"></span> &nbsp; Aguarde logando.');
            },

            success :  function(response) {

                if(response.status === true){
                    $("#btn-login").html('<img src="../img/rolling.gif" /> &nbsp; Logado você vai ser redirecionado');

                    setTimeout(function(){location.href=response.redirect} , 2000);
                }
                else{
                    $("#error").fadeIn(100, function(){
                        $("#error").html('<div class="alert alert-danger"> <span class="glyphicon glyphicon-info-sign"></span> &nbsp; '+response.msg+' !</div>');
                        $("#btn-login").html('<span class="glyphicon glyphicon-log-in"></span> &nbsp; Entrar');
                    });
                }
            }
        });
        return false;
    }


});

someone there has already gone through this problem ??? is not returning nor an error on the console.

  • I need to see your HTML.

  • Hello, do not return an error in the console does not mean that everything is correct, you are sending information and receiving via ajax, however it generates response, if you need to check what is received in the api and what is being sent as a return to ajax, see item by item very detailed.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.