Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> JavaScript >> Snippet

Open a new window (in current window)


window.open() is the method to use.  it support 4 optional arguments
- URL
- name
- featuresList
- replace


//new empty window
window.open()
or
var blankWindow = window.open()  // sets a JavaScript variable reference to the window


//new window with specified URL
window.open ( " http://www.garybeene.com " )
or
var filledWindow = window.open ( " http://www.garybeene.com " )


featuresList has the following flags that can be used in the string.  To set a flag, just
enter 'flagname = yes' in the string. Separate flags by commas :

directoriies yes / no   if window should have a set of directory buttons
height  positive integer height in pixels
width  postive integer width in pixels
location  yes / no   if window should have box user can type URL into
menubar  yes / no   if window should have main menu bar
resizable  yes / no   if user is allowed to resize the window
scrollbars  yes / no   if the window should have scroll bars
status  yes / no   if there should be a status bar at the bottom of the window
toolbar  yes / no   if window should have a main toolbar