|
May 6, 2000 Sniffing Window Existence Tips: May 2000
Yehuda Shiran, Ph.D.
|
|
Each browser window is associated with an explicit window object. Therefore, when you want to refer to the current window (the one containing your script), you should use the window object. The following statement sets the URL of the current window:
When you put such a statement in a script, you don't need to specify the window object, because the existence of the current window is assumed:
Note that self is equivalent to window, so self.close() is actually the same as window.close().
When you want to handle a window, you must make sure it still exists. Before you declare a variable for a
If you want to perform an operation on the new window, you should first check if the variable
Note that
People who read this tip also read these tips: Look for similar tips by subject: |