Javascript- Pop Up window Using the window.open method

The syntax of the window.open method is given below:

window.open (URL, windowName, Features)

URL:
The URL of the page to open in the new window. This argument could be blank.

Window Name:
A name to be given to the new window. The name can be used to
refer this window again.

Features:
A string that determines the various window features to be included
in the pop up window (like status bar, address bar etc)

Code to opens a new browser window with standard features.
window.open ("http://www.google.com","mywindow");

Following are the features of window.open method:
status: status bar at the bottom of the window.(e.g: status=1 or 0)
toolbar: The standard browser toolbar, with buttons such as
Back and Forward. (e.g: toolbar=1 or 0)
location: The Location entry field where you enter the URL.(e.g: location=1 or 0)
menubar: The menu bar of the window (e.g: menubar=1 or 0)
resizable: Allow/Disallow the user to resize the window.(e.g: resizable=1 or 0)
scrollbars: Enable the scrollbars if the document is bigger than the
window(e.g: scrollbars=1 or 0)
height: Specifies the height of the window in pixels. (e.g: height='200')
width: Specifies the width of the window in pixels. (e.g: width='200')

Example:
The following code opens a window with menu bar and toolbar.
The window is resizable and is having 350 pixels width and 250 pixels height.
window.open ("http://www.google.com ",
"mywindow","menubar=1,resizable=1,toolbar=1,
width=350,height=250");

0 comments: