Click to See Complete Forum and Search --> : want to open a window when closing of another window HOW?
niroshan
06-06-2003, 05:57 AM
Hi everyone,
I want to open a new window(html file) when closing a previously opened window. I know i can do this by using the script below on onUnload event of the first window.,
window.open('secondFile.htm');
but my problem is i`m using frames in my first window so eventhough i called this in that framed window it doesn`t raise the onUnload event of that window. Without frames it works fine.
what shall i do?.
I would really appreciate it if some one can help me with my problem.
need a very speedy reply.
thnax,
regards,
Niroshan
hmmm if i have understood somtehing like that could make it...
var dynamicname = 1
var mypopup=null;
function popup(URL, winW, winH, dynamicname++)
{
var winwidth = winW;
var winheight = winH;
var winleft = 150;
var wintop = 50;
if ( mypopup && !mypopup.closed )
{
mypopup.close();
}
mypopup= """all stuff like scroll bars width et..."""
script no tested...
cheers
asch
:D
niroshan
06-06-2003, 10:13 PM
Hi,
Thnax for your reply. But i still didn`t get it. first thing i didn`t get it is where this popup function should end cos there is no endding }. The other thing is where should i call this function. because when i used frames the onunload event of body tag does not raised.
what I want is to open a new window when closing a FRAMED window.
I hope everybody undustood my problem if not please ask any doubt.
thankx,
regards,
Niroshan
Khalid Ali
06-06-2003, 10:17 PM
you need to use onunload event of the page that has the frameset code in it.
<frameset.....
</frameset>
yeah thats what the script does or should do :O) ... you must....put this
--------------
<SCRIPT LANGUAGE="JavaScript"> //@ the beginning
--------------
} // I have forgotten this one :O)
</SCRIPT> // @ the end
-------------
my pop up can be deffined like this :(replace it with the actual one)...
------------------------
mypopup = window.open(URL, dynamicname, 'scrollbars=0,menubar=1,resizable=0,toolbar=0,status=0,top=' + wintop + ',left=' + winleft + 'screenX=' + wintop + ',screenY=' + winleft + ',height=' + winheight + ',width=' + winwidth);
------------------------
cheers
asch
:D
niroshan
06-09-2003, 12:10 AM
hi,
Thank you all for your replys. I really appreciate it.
regards,
Niroshan