Ajax does not work on android

0

I am making an ajax request that works perfectly on the Desktop, however when I test on android it does not work, if anyone can help me

jQuery(document).ready(function($){
        $("#loginform").on('submit', function() {
            var input_data = $('#loginform').serialize();
            $.ajax({
                type: "POST",
                url: "<?php echo site_url('wp-login.php','login_post'); ?>",
                data: input_data,
                success: function(msg) {
                    var reg1 = /login_error/g;
                    if (reg1.test(msg)) {
                         $('#message').html("Usuário ou senha incorretos.");
                    }else {
                        // login success. redirect users to some page.
                        //$(location).attr('href', '/my-account/');
                        //or reload the same page
                        if($('#user_pass').val() != '' && $('#user_login').val() != '') {
                          location.reload();
                        } else {
                          $('#message').html("Usuário ou senha não preenchidos!");
                          $('#message').fadeIn();
                        }
                    }
                }
            });
            return false;
        });
    });
    
asked by anonymous 11.01.2018 / 09:13

1 answer

0

Add jQuery mobile to your project. It allows you to use jQuery commands for all mobile devices, both ios and android. After entering the project just use jQuery the way you are already accustomed.

Note: Check the version of jQuery used in your project, so that you can download a compatible version of jQuery mobile.

Link: link

    
11.01.2018 / 11:19