0
I can’t redirect my page after entering login data windows.location.href command seems not to work!!!
$(document).ready(function () {
$("#signup-form").submit(function () {
var nm1 = $("#name1").val();
var ps1 = $("#pass1").val();
localStorage.setItem("n1", nm1);
localStorage.setItem("p1", ps1);
});
$("#login-form").submit(function () {
var enteredName = $("#name2").val();
var enteredPass = $("#pass2").val();
var storedName = localStorage.getItem("n1");
var storedPass = localStorage.getItem("p1");
if (enteredName == storedName && enteredPass == storedPass) {
alert("Voce esta logado!");
window.location.href = "http://www.devmedia.com.br/";
}
else {
alert("Nome do usuario ou palavra passe nao correspondente!");
}
});
});