$(document).ready(function() { if (window.location.protocol == "http:") { window.location.protocol = "https:"; return; } inicializar_interface(); }); let inicializar_interface = ()=>{ console.log("iniciando..."); if (sessionStorage.SID || null) { console.log("redirecionando"); window.location.href = "debitos.html"; return; } $("#logar").on("click", async (evento)=>{ let usuario = $("#user").val(); let senha = $("#password").val(); let resultado = await engine.logar(usuario, senha); if (resultado.ERRO == 0) { window.location.href = "debitos.html"; // if ($("body").width() <= 700) // window.location.href = "debitos_m.html"; // else // window.location.href = "debitos.html"; } else { alert("Usuário e/ou senha incorretos..."); } }); $("#user").on("keyup", function(x) { if (x.keyCode == 13) $("#password").focus()}); $("#password").on("keyup", function(x) { if (x.keyCode == 13) $("#logar").trigger("click")}); }