T
Tom de Neef
A user click will result in calling up and filling a secundary window. When
that secundary window already exists, it should be cleared so that the user
sees the window empty while waiting for a respons from the server. When the
secundary window does not yet exist, it should be created and focused and
then filled.
I have used this code:
{code}
var secondWindow = null;
function load2ndWindow(query) {
if (secondWindow) secondWindow.document.write(emptyDoc);
secondWindow =
window.open(query,"Support","menubar,resizable,width=600,height=300,scrollbars");
secondWindow.focus();
}
{code}
This works as long as the main page is not reloaded. But when it is
reloaded, the script is reloaded as well and the link between variable
secondWindow and the secundary window is broken.
I have two questions:
a) how come that the browser will re-use the secundary window when
load2ndWindow() is called after a page reload? It seems more reasonable when
it creates a new secundary window and leaves the existing one intact. As it
is though, this suits me.
b) how can I clear this secundary window that is about to be re-used by the
browser after the main page is reloaded and the secondWindow variable no
longer points to it?
I hope that I have described my problem adequately.
Thank you,
Tom
that secundary window already exists, it should be cleared so that the user
sees the window empty while waiting for a respons from the server. When the
secundary window does not yet exist, it should be created and focused and
then filled.
I have used this code:
{code}
var secondWindow = null;
function load2ndWindow(query) {
if (secondWindow) secondWindow.document.write(emptyDoc);
secondWindow =
window.open(query,"Support","menubar,resizable,width=600,height=300,scrollbars");
secondWindow.focus();
}
{code}
This works as long as the main page is not reloaded. But when it is
reloaded, the script is reloaded as well and the link between variable
secondWindow and the secundary window is broken.
I have two questions:
a) how come that the browser will re-use the secundary window when
load2ndWindow() is called after a page reload? It seems more reasonable when
it creates a new secundary window and leaves the existing one intact. As it
is though, this suits me.
b) how can I clear this secundary window that is about to be re-used by the
browser after the main page is reloaded and the secondWindow variable no
longer points to it?
I hope that I have described my problem adequately.
Thank you,
Tom