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!

Open and close windows

Status
Not open for further replies.

JohnBi

Technical User
Feb 14, 2002
6
IT
Hello to every body.

From the index page (window 1) I open a pop-up (window 2)which open another pop-up (window 3).

The link on window 2 to open window 3 is:
<a href="javascript:void(0);" onClick="window.open('events/even_frame.htm','mywindow','top=0,left=0,width=800,height=600,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes');opener.opener=opener; opener.close(); self.close();"><font color="#FF0000">Veranstaltungen - calendario eventi - events</font></a

And it is OK.

However if I click on a link on window 3 which open window 1 again and repeat the procedure as above, all windows are closed, while I want window 3 to remain open.
Any help please? Where am I wrong.

Thanks and regards
John

 
Gosh, for a moment there I thought Tek Tips was wacked out, the Message box was nowhere to be seen. When you post code, use the Tecumsah markup tags for code.
[ignore]
Code:
 ...
[/ignore]
Code:
onClick="window.open('events/even_frame.htm','mywindow','top=0,left=0,width=800,height=600,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes');opener.opener=opener;
The reason the windows disappear when you load a new page into Window 1 might be because Window 3 belongs to (is part of, is a child of) Window 2 which is part of Window 1. If you replace the page in Window 1 maybe that entails replacing all of the parts of the document in Window 1.

There is some question as to whether the parent-child relationship between the windows is a property of the Window or of the document in the Window.

Have you tried parent.window_two.location = 'url' instead of window.open('url')?
 
Thanks for your suggestion, however seems not working.
It might be that my knowledge of js are quite limited, so ....

Regards
John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top