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

1

In the following situation, my login form is working perfectly on the desktop version, I went to test on android and on ios it does not work and does not give an error in the console ... just wait for the api .. 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;
    }


});

Has anyone ever had this problem? is not returning an error in the console.

    
asked by anonymous 06.08.2016 / 01:37

0 answers