[Javascript] Active windows

Peter Brunone peter at brunone.com
Sat Dec 13 23:50:51 CST 2003


Tim,

	There are two ways you could do this.  If the user is going to
click a button or link or something to close the window, you can capture
the onClick event and trigger a window.parent.reload().

	If you won't necessarily know when the child closes, you can use
the onClick of the link in the parent window.  Say your link leads to
the following function, setWaitWindow()...

<script language="Javascript">

var waitWin;

function setWaitWindow(theURL) {
   // open the new window, setting it to the global variable defined
above
   waitWin = window.open(theURL, "waitWin", "attributeshere");
   // set off the waiting function
   checkWindow();
   }


function checkWindow() {
    if(contentWindow.closed) {
        // the window has been closed; refresh this one
        window.location.reload();
        }
    else {
        // it's still open; wait 500 milliseconds and try again
        setTimeout("checkWindow()", 500);
        }
    }

</script>

Cheers,

Peter

-----Original Message-----
From: javascript-bounces at LaTech.edu
[mailto:javascript-bounces at LaTech.edu] On Behalf Of Info at Best-IT
Sent: Saturday, December 13, 2003 3:32 PM
To: Javascript
Subject: [Javascript] Active windows


I am looking for  way to manipulate active windows.  I am using IE 5.5,
not sure if there is a difference for IE 6.

I use a link on the active window to open a smaller window with a form.
When the small window is closed I would like the newly active large
window to refresh thus refreshing with the newly added information.  Is
there anything I can use with the onClick event to do this?

/Tim 





More information about the Javascript mailing list