|
May 15, 2000 Closing Child Windows Tips: May 2000
Yehuda Shiran, Ph.D.
|
|
The dependent window feature specifies
whether the window should be a dependent child of the current (opener) window.
A dependent window closes when its parent window closes. This dependent feature
is only supported by Navigator 4 and above. However, we can use a bit of JavaScript
to deliver a cross-browser solution. Let's use the following function to open
our dependent window:
We'll include an
Note that the new window will close when the current document unloads, even if the current window is still open. Here's the code for the
Notice that we must check if the window exists before we attempt to close it. To learn more, have a look at a complete demonstration in Tutorial 1.
People who read this tip also read these tips: Look for similar tips by subject: |