views:

22

answers:

2

i have a page which has 4 frames the code is as below

<frameset id = framset_page rows="30,*" cols="*" border="0">
  <frame name="topFrame" id="topFrame" noresize scrolling="NO" src="topFrame.jsp">
   <frameset  cols="200,50,*">
    <frame src="FramesetLeftFrame.jsp" />
    <frame src="middle.html" />
      <frame src="FramesetRightFrame.jsp" />
   </frameset>
</frameset>

the topFrame include a logout button.but what when i click the logout button,it just exit the topFrame others remain the same.how can i exit other frames either?writing code in the topFrame seems not work.thank you!

A: 

Please post the code for your logout button, form. However, if it is a form or a link/button, setting target="_top" might do what you're looking for.

Jhong
just like this<a class="header" target="_top" href="logoff.jsp">Exit</a>thank you jhong.
huangli
Yes, exactly :-)
Jhong
A: 

You can add target="_top" to your link or you can use javascript to navigate using your top frame:

self.parent.location= "URL TO logout";

Examples:

<a href="logout.php" target="_top">Logout</a>

<a href="javascript://" onclick="self.parent.location='logout.php'">Logout</a>

Other alternative is, into your logged out page, add a javascript code to remove the frames redirecting your document to the top frame:

<script type="text/javascript"> 
    if (self.parent.frames.length != 0){
        self.parent.location=document.location.href;
    }
</script>
Dubas