PDA

View Full Version : How to close a window via anotherframe


gopitamil
Aug 29, 2007, 04:57 AM
Here I have two frames

Frame1 with a link,frame 2 with logout
Whenever I click a link in frame1 a new popup window will open.
I have to close that window via frame2 logout option.
Can anyone help?

WadeG
Aug 29, 2007, 05:02 AM
here i have two frames

frame1 with a link,frame 2 with logout
whenever i click a link in frame1 a new popup window will open.
i have to close that window via frame2 logout option.
can anyone help?
I am assuming you are spoeaking of HTML?
If so are you using a editor (ie. Front page)? Are you able to let us see the code?

jstrike
Sep 4, 2007, 09:54 PM
If you have a JavaScript function that opens a window in Frame 1, put a function on that same frame to close the window.
For example:


var winHandle;
function openWindow() {
winHandle=open(.....);
}

function closeWindow() {
winHandle.close();
}
In frame 2 when you want to close the popup refer to the function in frame 1 by using parent.


function logout() {
...do some stuff...
parent.closeWindow();
I'm doing this off the top of my head so you'll obviously have to mess around with it a bit, but that should give you an idea of the general concept.

Good Luck.