PDA

View Full Version : closing one of the frame



janunme
04-11-2007, 07:34 AM
hi to all,

i am facing a problem and that problem is:

using frames i devided my page i to two parts( frame1, frame2) in frame1 there is a link called "LOGOUT". when ever i click on this i want to close what ever page on the frame2 and display logout page. how to do it.

regards

tech_support
04-11-2007, 07:51 AM
In your link tag type target="_top" eg.



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


Edit: Didn't realize that you wanted to close the frame.

janunme
04-11-2007, 08:47 AM
i think "_top" is name of secound frame. is it correct

tech_support
04-11-2007, 09:00 AM
Nope, _top means the window, not any frame.

janunme
04-11-2007, 09:26 AM
ni i want to close one of the frames page only. not all frames

tech_support
04-11-2007, 09:28 AM
You have 2 frames, frame1 and frame2. If you close one frame, you'll have one left.

janunme
04-11-2007, 09:43 AM
yes but it should display blank and at frame1 it should display login page. that is the frame1 looks like a navigating page

tech_support
04-11-2007, 09:48 AM
Then you can use this:



<a href="logout.php" target="frame2" onClick="document.frames['frame2'].location.href = '' ">Logout</a>


Untested.

janunme
04-11-2007, 11:36 AM
thanks for your reply it is working but if i want to change "frame1" page also like after clicking on "logout" "frame1" should display login page. in order to do that where should i include that code.