I know pop-up windows are generally considered to be a bad thing; however, this script has served me well over the years and so I thought I’d share it.
The script works in all the major web browsers: Internet Explorer, Netscape, Mozilla and Opera.
View examples of this script in action.
STEP 1. Insert the script in your page. Put the following script in the
<head> section of your launching page.
STEP 2. Launch the popup window. Call the script from a link, like this:
<a href="#null" onClick="newWindow('yourpage.html','','750', '450','resizable,scrollbars,status,toolbar')"> Open in new window</a> // Variables: // 750 - width // 450 - height // resizable - window can be resized // scrollbars - window displays the scrollbar on the right // status - window displays the status bar at the bottom // toolbar - window displays the toolbar at the top
href="#null" makes the link display as a link. Don’t leave it out!
A Note of Caution
Remember, if you plan to use this script, think very carefully about whether it is actually a good idea to make the page open in a new window.
This article from Sitepoint, Beware of Opening Links in a New Window, explains why it probably is not.