Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Options available for new windows.

Opening and closing a window

Options available for new windows.

by  GIGN  Posted    (Edited  )
Due to high demand for new windows lately I thought people may like a list of the parameters available.

for window.open('name.htm','windowName','parameters')

All the parameters must be enclosed as a single string with comma's separating them, and no spaces (or they won't work).

They are entered as : parameter=value pairs, these parameters (the ones I know of) are:
[color blue]
dependant=yes/no
directories=yes/no
height=pixel value (replaced in 1.2 with inner/outer)
width=pixel value (replaced in 1.2 with inner/outer)
location=yes/no
hotkeys=yes/no
innerHeight=pixel value
innerWidth=pixel value
menubar=yes/no
outerHeight=pixel value
outerWidth=pixel value
resizable=yes/no
left=pixel value (NN4+ --> screenX)
top=pixel value (NN4+ --> screenY)
scrollbars=yes/no
titlebar=yes/no
toolbar=yes/no
z-lock=yes/no
copyhistory=yes/no [/color]
You can set attributes for both browsers at once, they will ignore ones they don't understand​
e.g.[color red]
var newOne = self.open('myWin.htm','Mine','menubar=no,titlebar=no') [/color]

The 'name' is used only for the target attribute of links and form submissions - so always attach to a variable, to perform any actions on the new window.

When working with new windows, the window which spawned the new one is referred to as the window's opener, not parent.Parent refers to frames pages.

[color red] opener.close() [/color]
This would close the window which opened our new one.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top