Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

closing one window from another window

Status
Not open for further replies.

michelledebeer

Programmer
Oct 26, 2001
22
0
0
SE
Case 1:
If I open a new window (B) from window A, I know I can close B from A. Can I close A from B?

Case 2:
I open window B from window A. Then I open window C from A.
Can I close B from C and C from B?

Hope you followed my trail of letters...

Any thoughts?
// Michelle
 
to case A you can try to use
opener.close()

to case B, i cannot help you out. Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
Case 1:
yes you can as Anikin stated use opener.close(). However it will ask you for confirmation in Internet Explorer but not in Mozilla or Netscape 6.

Case 2:
It should all be possible but keep in mind that you will need to do a lot of complicated referencing (opener.windowName.close()) most experienced programmers on this forum can't tell you just off the top of their heads how to reference these windows because they shun opening too many popups. This is because in most cases using popups only causes more problems then fixing solutions. One rule of thumb : amount of problems in your page is directly proportional to the square number of popups plus the square of the number of levels.

Check
if you really want to have problems and use too many popups good luck to you! :)

Hope this helps. Gary Haran
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top