PDA

View Full Version : Close frameset from popup


Mr J
05-22-2003, 08:21 PM
A popup window is opened from a page in a frameset.

How can the frameset be closed from a link in the popup window

Vladdy
05-22-2003, 08:40 PM
If you were not using framesets and popups, you would not have this problem ;)

Mr J
05-22-2003, 08:46 PM
There are many things in life that we should, or should not do, but answers still have to be sought

cheesebagpipe
05-22-2003, 08:59 PM
2-shay...:thumbsup:

Vladdy
05-22-2003, 09:05 PM
Originally posted by Mr J
There are many things in life that we should, or should not do, but answers still have to be sought
that's what I call mental mastrubation: you create a problem and then solve it just to please yourself. :D :D :D

Mr J
05-22-2003, 10:24 PM
But the question remains.

Can it be done

:D

sage45
05-22-2003, 11:02 PM
Try:

parent.opener.close();

-sage-

Mr J
05-22-2003, 11:15 PM
I have done a bit of experimenting since my last reply and find the following scripts work.

Close frameset from within a frame

In the frame closing the frameset.

<script language=JavaScript type=text/JavaScript>
<!--
function close_all(){
parent.opener = top
parent.close()
}
// -- >
</script>

Use an event to call close_all()

Close frameset from a popup

In the popup page.

<script language=JavaScript type=text/JavaScript>
<!--
function close_frameset(){
opener.parent.opener = top
opener.parent.close()
}

window.onerror=sh
function sh(){
return true
}

onload=close_frameset
// -- >
</script>