利用用户登陆名Session("MM_username")判断显示和隐藏层问题
function login(){HttpSession Session = request.getSession();
var aa = Session.getAttribute("MM_username");
if(aa == ""){
document.getElementById('top_2').style.display = "inline";
document.getElementById('top_3').style.display = "none";
}
else{
document.getElementById('top_2').style.display = "none";
document.getElementById('top_3').style.display = "inline";
}
}
.
.
.
<a href="javascript:login()" onclick="submit()">[登陆]</a>
<div id="top_2">222</div>
<div id="top_3">333</div>
这是个用dw做的用户登录,登陆之后top_2隐藏,top_3显示代码。没登陆时top_2显示 top_3隐藏的。请问哪里做得不对?
MM_username是存放登陆成功后的用户名