PDA

View Full Version : frameset onunload event


netspace
02-26-2003, 07:02 PM
Hello;

My goal is to open a new window when a window containing a frameset will be closed,

could you please give some hint how to achieve this goal.

Sincerely,

Kris

Mr J
02-28-2003, 08:42 PM
There are probably a few ways this can be achieved.

The following can be placed in any page but it really needs to be in a page that is always loaded in a frame such as the header or navigation.

Or you could try placing it in the actual frameset page



<SCRIPT language=JavaScript>
var exit=true;
function goodbye()
{
if (exit)
open("yourpage.htm"); <!--Place your path and file name here-->
}
</SCRIPT>


Add onunload=goodbye() to the opening <Body> tag

<BODY onunload=goodbye()>

netspace
03-01-2003, 11:00 PM
actually, i tried onunload=function(); on a frameset page and in a html representing a frame, but because there was some bug in one of the javascript in this page, the whole frameset did not produce onunload effect.

After fixing the bug, onunload event works in many different way i could not see before. yes, it is possible to place onunload either in body or frameset or use on exit function to execute any other function, in my case window.open

thanks for help, kris