Forum Moderators: open
You can always do this:
if(window_name.focus()) {
// do stuff
window_name.location.href = "whatever.html";
}
else {
window.open(...);
}
That will, if the window exists, move focus to that window before doing something (here, opening a new page in that window).
If the window doesn't exist, it will be created...
Also:
Wheen I load a new Page into the main window there is no way to access the popup via window_name. A new Page was opened window_name is not known anymore in the main window. window_name.focus() on the new page is not possible anymore but the popupwindow still exists and it would be no need to open one ....
when I put your code in the html-file that will be opened in the mainbrowserwindow a window with the reference object window_name is created and references to the popupwindow because of window_name=window.open(). This reference exitst only as long as the page (where it was defined) is loaded in the mainbrowserwindow. When this page is closed (i.e. by following a a link on this page) the reference is killed (but the window of course keeps on existing). On the new loaded bage we could again include the code above. Again a (new) reference is created and a popup will be opened. But it would not have been necessary to (re)open the window (and trigger traffic because of reloading the popuppage) because the window was still there ....
That`s what I assume ....