May 14 2008
Onclick window open options
Ok, here’s a coding tutorial that will help you open a NEW window when a link is clicked, but it will give you several OPTIONS of what you want to do with that window. For example, maybe you want to RESIZE the window - that is what I often find is necessary.
First off, the code will look like this:

As you can see, the TEXT for your link is ‘Click here to open this popup window’.
Now, the javascript is telling the link that when someone clicks (onclick) the window opens (window.open) and then the stuff after that is describing it. Please note that all the the attributes are separated by commas and no spaces!
Now, keep in mind that there are a BUNCH of things you can do to this link. These are called ‘attributes’. Here is a list of the most popular:
Window Attributes
Below is a list of the attributes you can use:
- Width=300
Defines the width of the new window. - Height=200
Defines the height of the new window. - Resizable=yes or no
Can the user resize the window. - Scrollbars=yes or no
Scrollbars on the window. - Toolbar=yes or no
Whether or not the new window should have the browser nav bar at the top (The back, foward, stop buttons..etc.). - Location=yes or no
Whether or not you wish to show the location box (the box where you type in the www…) - Directories=yes or no
Whether or not the window should show the extra buttons. (what’s cool, personal buttons, etc…). - Status=yes or no
Window status bar at the bottom of the window. - Menubar=yes or no
Menus at the top of the window (File, Edit, etc…). - Copyhistory=yes or no
Copy the old browser window’s history list to the new window.
Ok, that’s it. Keep in mind that if you do not define (list) an attribute, it will typically default to NO.
















