boptix
04-11-2005, 07:33 PM
I have two simple HTML-documents: 'page_a.htm' and 'page_b.htm'. Both documents must be open at the same time, which can be achieved in two different ways:
- 'frameset mode': 'page_a.htm' and 'page_b.htm' are loaded into seperate frames in a frameset
- 'popup mode': 'page_b.htm' is loaded into a popup window, 'page_a.htm' into the main window
The user must be able to switch between 'frameset mode' and 'popup mode' by clicking on the 'Change mode' link in 'page_b.htm'.
Switching from 'frameset mode' to 'popup mode' works fine (please try it on the demo page: http://boptix.50webs.com/frameset.htm). However, when you want to switch back to 'frameset mode' a problem occurs: the main window (with 'page_a.htm' in it) can't be accessed, because the 'opener' frame does not exist anymore (the 'frameset.htm' was replaced by 'page_a.htm' when switching to 'popup mode').
I tried to set the name of the main window by adding an 'onload' attribute:
<body onload="window.name='blah';">
This works partially: the window name is set, but it seems that the new window name can only be used in the 'target'-attribute of <a>-tags and NOT in JavaScript.
Does anyone have an idea how to solve this? How can I get a handle to the main window so I can switch back to 'frameset mode'?
- 'frameset mode': 'page_a.htm' and 'page_b.htm' are loaded into seperate frames in a frameset
- 'popup mode': 'page_b.htm' is loaded into a popup window, 'page_a.htm' into the main window
The user must be able to switch between 'frameset mode' and 'popup mode' by clicking on the 'Change mode' link in 'page_b.htm'.
Switching from 'frameset mode' to 'popup mode' works fine (please try it on the demo page: http://boptix.50webs.com/frameset.htm). However, when you want to switch back to 'frameset mode' a problem occurs: the main window (with 'page_a.htm' in it) can't be accessed, because the 'opener' frame does not exist anymore (the 'frameset.htm' was replaced by 'page_a.htm' when switching to 'popup mode').
I tried to set the name of the main window by adding an 'onload' attribute:
<body onload="window.name='blah';">
This works partially: the window name is set, but it seems that the new window name can only be used in the 'target'-attribute of <a>-tags and NOT in JavaScript.
Does anyone have an idea how to solve this? How can I get a handle to the main window so I can switch back to 'frameset mode'?