javascript - condition display the logout button in frame -
i've webapp uses next frameset code display frames on webpages. myaccounttopframe.jsp frame in frameset contains logout button user can click logout site. logout button beingness displayed on webpages, including login page. wonder if there way display logout button on pages except login page.
<html xmlns="http://www.w3.org/1999/xhtml"> <frameset rows="31px,*" border="0" frameborder="0" framespacing="0"> <frame src="myaccounttopframe.jsp" name="top" frameborder="0" scrolling="no" > <frame src="<%=iframesrc%>" name="bottom" frameborder="0" style="display:block; align:top;"> </frameset> </html>
thanks
i did next resolve issue:
1) add together onload="togglelogoutbutton()" "bottom" frame.
2) add together toggleloutoutbutton js hide or display logout button base of operations on "bottom" frame path.
see below:
<frameset rows="31px,*" border="0" frameborder="0" framespacing="0"> <frame src="myaccounttopframe.jsp" name="top" frameborder="0" scrolling="no"> <frame src="<%=iframesrc%>" name="bottom" frameborder="0" style="display:block; align:top;" onload="togglelogoutbutton()"> </frameset> function togglelogoutbutton() { seek { // current location var currentpath = window.frames[1].location.pathname; // hide logout button if in login page. otherwise, show it. if (currentpath.tolowercase() == "/login2.jsp" || currentpath.tolowercase() == "/login_outage.jsp") window.frames[0].document.getelementbyid("logoutbutton").style.display="none"; else { window.frames[0].document.getelementbyid("logoutbutton").style.display="inline"; } } catch(err) { }
javascript html
No comments:
Post a Comment