by Jocelyn Kinnear
email this articleSummary : Here is a valid way to open links in a new window using JavaScript. This is easy to use and customize.
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)" onclick="window.open('http://website.com','Bravenet.com', 'width=200,height=200')">
Open a New Window
</a>
Customize the Script for Your Site:
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.