Мне трудно скрыть определенную панель навигации, когда пользователь успешно вошел в систему как администратор, я хочу скрыть класс панели навигации с именем "ordertrackingClass", когда пользователь входит в систему как администратор. вот мой код.
function validateUser(){
enteredUsername = $("#usernameSignIn").val();
enteredPassword = $("#passwordSignIn").val();
var users = JSON.parse(sessionStorage.getItem("userRecord"));
for(i = 0; i < users.length; i++){
if(enteredUsername == users[i].Username && enteredPassword == users[i].Password){
if(users[i].AccessType == "1"){
swal({title: "Log in Successful!", text: "Log in as customer", icon:
"success"});
}else if(users[i].AccessType == "2"){
swal({title: "Log in Successful!", text: "Log in as Staff", icon:
"success"});
}else if(users[i].AccessType == "3"){
swal({title: "Log in Successfully!", text: "Log in as Admin", icon:
"success"}).then(function(){
window.location = "Home.html"
$('li.orderTrackingClass').hide();
}
); //end of swal
}
return;
}
}
swal({title: "Log in Failed!", text: "Incorrect credentials", icon:
"error"});