28-08-2010

Javascript window.open method

You use the window.open method to open a new window in javaScript. The arguments to this method are as follows:

winRef = window.open( URL, name [ , options] )

the WinRef variable now holds a reference to the new window object. You can call other window methods on it such as winRef.close() or winRef.focus().

The name argument is used to refer to the new window object later. For instance in HTML links you can specify the target of a link as <a target=name href="page.htm">

The optional arguments are defined as follows:

toolbar=0|1	Specifies whether to display the toolbar in the new window.
location=0|1	Specifies whether to display the address line in the new window.
directories=0|1	Specifies whether to display the Netscape directory buttons.
status=0|1	Specifies whether to display the browser status bar.
menubar=0|1 	Specifies whether to display the browser menu bar.
scrollbars=0|1 	Specifies whether the new window should have scrollbars.
resizable=0|1 	Specifies whether the new window is resizable.
width=pixels 	Specifies the width of the new window.
height=pixels 	Specifies the height of the new window.
top=pixels 	Specifies the Y coordinate of the top left corner of the new window. 
left=pixels 	Specifies the X coordinate of the top left corner of the new window.

An example of the window.open method:

window.open('http://yourdomainname.com/','myWindow','width=200,height=100,scrollbars=yes,toolbar=yes,location=yes');

Comments:

Your comment:

»

 

[x]