title: preventDefault() doesn't work appropriately
body: <p>Today I am testing an application and I have a problem with the preventDefault (), on my computer it works correctly and in most of the users they have not had any problem, of the 30 users who are testing it, 2 tell me the same error, they send them to the post file of the login form, it actually logs them in correctly since in a JSON type array I determine if the password_verify is correct or not to communicate it with ajax, but it directly redirects them to the insert_user.php file and does not take Note the preentDefault (), nor the commit AJAX alert and the redirect to where it should take them.</p>
  <p>This is the file that carries the post request</p>
  <pre><code>    if (isset($_POST['login-value'])) {
      //die(json_encode($_POST));
      $correo = $_POST['login-email'];
  
      try {
          include_once 'funciones.php';
          $password = $_POST['login-pass'];
          $stmt = $conn-&gt;prepare(&quot;SELECT * FROM usuarios WHERE correo_usuario = ?&quot;);
          $stmt-&gt;bind_param(&quot;s&quot;, $correo);
          $stmt-&gt;execute();
          $stmt-&gt;bind_result($id_user, $nombre_user, $apellido_user, $correo_user, $password_user, $tipo, $status);
          if ($stmt-&gt;affected_rows) {
              $existe = $stmt-&gt;fetch();
              if ($existe) {
                  if (password_verify($password, $password_user)) {
                      if ($status == 'activo') {
                          session_start();
                          $_SESSION['usuario'] = $correo_user;
                          $_SESSION['nombre'] = $nombre_user;
                          $_SESSION['id'] = $id_user;
                          $_SESSION['tipo'] = $tipo;
                          $respuesta = array(
                              'respuesta' =&gt; 'exito',
                              'usuario' =&gt; $nombre_user
                          );
                      } else {
                          $respuesta = array(
                              'respuesta' =&gt; 'error'
                          );
                      }
                  } else {
                      $respuesta = array(
                          'respuesta' =&gt; 'error'
                      );
                  }
              } else {
                  $respuesta = array(
                      'respuesta' =&gt; 'error'
                  );
              }
          }
          $stmt-&gt;close();
          $conn-&gt;close();
      } catch (Exception $th) {
          echo &quot;error: &quot; . $th-&gt;getMessage();
      }
      die(json_encode($respuesta));
  }
  </code></pre>
  <p>And this is the js file with the AJAX and the preventDefault ()</p>
  <pre><code>    if (document.getElementById(&quot;login-user-form&quot;)) {
      document.getElementById(&quot;login-user-form&quot;).addEventListener('submit', function (e) {
          e.preventDefault();
          var datos = $(this).serializeArray();
          var correo = document.getElementById(&quot;login-email&quot;).value;
          var password = document.getElementById(&quot;login-pass&quot;).value;
  
          //Validaciones
          if (correo == &quot;&quot;) {
              Swal.fire(
                  'Error!',
                  'Ingresa un correo válido',
                  'error'
              )
          } else {
              if (password == &quot;&quot;) {
                  Swal.fire(
                      'Error!',
                      'Ingresa una contraseña válida',
                      'error'
                  )
              } else {
                  $.ajax({
                      type: $(this).attr('method'),
                      data: datos,
                      url: $(this).attr('action'),
                      dataType: 'json',
                      success: function (data) {
                          var resultado = data; 
                          if (resultado.respuesta ==&quot;exito&quot;) {
                              Swal.fire({
                                  title: 'Correcto',
                                  text: &quot;Inicio de sesión correcto!&quot;,
                                  icon: 'success',
                                  showConfirmButton: false
                              })
                              setTimeout(function () {
                                  window.location.href = 'index-app';
                              },1000);
                          } else {
                              Swal.fire(
                                  'Error!',
                                  'Usuario o contraseña incorrecto, intentalo de nuevo!',
                                  'error'
                              )
                          }
                      }
                  })
              }
          }
      });
  }
  </code></pre>
  <p>What puzzles me a bit is why in 94% of the users I have no problem and in these 2 there is.</p>
  <p>The only constant is that those 2 users do not work in the Google Chrome browser, I do not know the version, since they are normal users who are not testing it by programmers of any kind.</p>