Forum Moderators: open

Message Too Old, No Replies

One window closing another window

         

srikanth

10:13 am on Dec 3, 2001 (gmt 0)

10+ Year Member



Anyone know How... when new window is open with CTRL-N or right click(with mouse ie open new window) then if you
try to close the previous window then new window should also be closed automatically.

FaSheZee

3:00 pm on Dec 3, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I strongly believe that you cannot close several browser windows at once.

A short cut you can use to close your windows
is; having your window active: Alt F4

Dats Wat i Tink!!!

srikanth

11:32 am on Dec 4, 2001 (gmt 0)

10+ Year Member



hi FaSheZee

i think u r not understand my question. my question is how to code in javascript when new window is open with CTRL-N or right click(with mouse ie open new window) then if you
try to close the previous window then new window should also be closed automatically.

srikanth

IanKelley

10:25 am on Dec 7, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



As far as I know it is not possible to close a window that the user opens manually because there is no 'child' property in javascript.

However, if it's a window that you open yourself it's no problem.

When you open the window, assign it a name:
goatygoodness=window.open()

Then in your <body> tag add:

onunload="goatygoodness.close()"