| Site Map | WizTools.org | jCraze Blog |
![]() |
Subhash's Guide: JavaScript WindowsWindow is the top object in the DOM hierarchy. And as any other object in the hierarchy, this too can be created manipulated and destroyed. Opening a New Window
The method open() should be called on the window object to open a window. A simple script showing how to open a window with the url 'http://www.indiwiz.com/' is given below:
<script language="JavaScript"> This function may be called through any link(<a href="javascript:popUp();">XXX</a>), form element or automatically on document loading or on closing an existing window.
The url parameter of the method open() is mandatory. So what if you wanted to open a blank window? Then you have to pass a null string as url. The same example would be: The second parameter of the method open() is name. This can be used with target attribute. Another important parameter which the method open() accepts is the 'features'. Using various arguments within this parameter you can customize the look, size, display area etc. of the window. The various arguments within this parameter are listed below:
One thing you have to note is that all these arguments form part of a single parameter. Thus the whole argument should be placed within quotes. The last in the list of parameters which the open() method accepts is the optional 'replace'. Unlike other parameters(which are strings), this one is a boolean argument. 'true' adds the displayed site to the browser history and vice versa. Open a Window with the following:
<script language="JavaScript"> Closing a Window
The close() method doesn't take any arguments. |
[Quick Stats: Number of main threads: 1, Number of sub-threads: 1]
Sign Guestbook
|
Who is Subhash?
The contents of this site are copyright© 2000-2008, indiWiz.com. All Rights Reserved.