Here is an easy way to open a browser in a new window with JavaScript. You might find it convenient to use something like the "target" attribute; however, this attribute is deprecated and shouldn't be used. Unlike the target attribute, you can specify the width and height of the window you are opening using the following method.
<a href="javascript:void(0);"
NAME="My Window Name" title=" My title here "
onClick=window.open("window-child.html","Ratting","width=550,height=170,0,status=0,");>Click here to open the child window</a>
Replace "Mt title here" with the titleu want on the window
In the code above, you will notice that there is a URL defined as "window-child.htm Replace that URL with the address of the page that you would like to open.
You will notice width=550. Replace "550" with the width size, in pixels, that you would like the new window to be.
height=170 As with the width, you can set the height of the new window here by replacing the "170" with your desired height.
Replace "Click here to open the child window" with the text that you would like your visitors to click on in order to open the new window.
Once the code is edited, you can place it anywhere in the body of your webpage. This code can be very helpful if you want to open a small window for something such as an image gallery.
You can also add any of therse tokens/ commands after " status, "
The table shows the features and the string tokens you can use:
status
The status bar at the bottom of the window.
toolbar
The standard browser toolbar, with buttons such as Back and Forward.
location
The Location entry field where you enter the URL.
menubar
The menu bar of the window
directories
The standard browser directory buttons, such as What's New and What's Cool
resizable
Allow/Disallow the user to resize the window.
scrollbars
Enable the scrollbars if the document is bigger than the window
height
Specifies the height of the window in pixels. (example: height='350')
width
Specifies the width of the window in pixels.
For example if you want to add scrollbars the script will look like this