H
H
Hy_ok2017-05-14 21:01:14
JavaScript
Hy_ok, 2017-05-14 21:01:14

Why does js script not work in mobile browser?

the script does not work in a mobile browser, on ios in any browser and on android in UcBrowse,

$.ajax({
            type: "POST",
            url: "/auth/",
            data: {
                "login" : $("input[name=login").val(),
                "password" : $("input[name=password").val()
            },
            success: function(data){
                console.log(data);
                if(data.error_password){
                    var error = '<span style="color:red">Не правильный логин или пароль!</span>';
                    $("#message").html(error).hide().fadeIn();
                    setTimeout(function(){$("#message").fadeOut();}, 3000);
                }else if(data.success){
                    jQuery(location).prop('href', '/');
                }
            
            }
        });

<html>
<head>
  <meta charset="UTF-8">
  <title>Авторизация</title>
  <link rel="stylesheet" href="/assets/login/css/style.css" media="screen" type="text/css" />
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  <script src="/assets/login/js.js"></script>
</head>
<body>


        <h1>Авторизация</h1>
                <input type="text" name="login" placeholder="Логин">
                <input type="password" name="password" placeholder="Пароль">
                <a href="#" onclick="login()"> ВОЙТИ</a>
                <span id="message" style="display:none;"></span>
        
</body>
</html>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2017-05-14
@Sanasol

https://jsconsole.com

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question