New Window
This script that opens a new window when a link is clicked.
Script Code
Grab a copy of the file below and place it in the same directory as the Web page on which
you will use the script (if you wish to place the script file in a different directory
you will need to make the necessary adjustments to the src attribute of the script tag
that calls it).
swin001.js
The code below should be placed between the <body> and </body> tags, someplace
after all the links you want to open a new window (probably near the end of the HTML code).
Example
Click the link below to open a page in a new window.
New Window
Options
You can select whether or not you want the window options (width, height, scrollbars, etc.)
on (where you can define their values) or
off (all options use browser default values):
var win_options = "on";
To turn this off, just change on to off (or anything other than
on). Note that Firefox and some other browsers may display the window
as a new tab rather than a new window if the options are turned off.
The basic window options can be defined either as numbers (for width and
height), or as yes or no (for all others):
var win_width = 640; // width
var win_height = 480; // height
var win_dirs = "yes"; // directories
var win_loc = "yes"; // location bar
var win_menu = "yes"; // menubar
var win_resz = "yes"; // resizable
var win_scroll = "yes"; // scrollbars
var win_stat = "yes"; // status bar
var win_tool = "yes"; // toolbar
Accessibility
For those without JavaScript, the new window page's URL should be used in the
href attribute of each link tag so that the new window's page will
still open in the same window for them.
Copyright © 1998-2010
The Web Design Resource. All rights reserved. See script or author's information for copyright information on the
individual scripts and/or writing.
Disclaimer