成功登录后如何在我的主页中包含注销链接 [英] how can i include a logout link in my home page after logged in successfully
本文介绍了成功登录后如何在我的主页中包含注销链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用html和servlet,我只想在成功登录后在我的主页中添加注销链接.
using html and servlets i just want to add a logout link in my home page after successfully logged in
推荐答案
您好,创建2个DIV,一个用于登录(用户名,密码,提交控件)和另一个用于注销(注销链接).
假设使用DIVLogin进行登录和DIVLogout用于注销
使用javascript,当用户登录后调用脚本
Hi, Create 2 DIVs, one for login(username, password, submit controls) & another one for logout(logout link).
Assume DIVLogin for Login & DIVLogout for Logout
using javascript, when user logged in then call the script
document.getElementById('DIVLogin').style.display = 'none';
document.getElementById('DIVLogout').style.display = 'block';
否则称为
otherwise call this
document.getElementById('DIVLogin').style.display = 'block';
document.getElementById('DIVLogout').style.display = 'none';
创建您的注销链接,并根据用户是否登录显示/隐藏它.
Create your logout link, and show/hide it depending on whether the user is logged in or not.
这篇关于成功登录后如何在我的主页中包含注销链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文