[thelist] Javascript Woes

jeff jeff at members.evolt.org
Mon Feb 19 21:05:22 CST 2001


salvatore,

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: From: Salvatore Palmisano
:
: window.open(page.asp?id=intID),null,'resizable=yes,
: toolbar=no,location=no,status=no,menubar=no,
: scrollbars=no,copyhistory=no,width=385,height=295;')">
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

the open() method of the window object takes three arguments, each one
wrapped in quotes (single or double) if they're not variables referring to
strings containing the necessary information.  so, you'll need to change a
couple of things with the way you're calling the method.

window.open(

the first argument is the location of the page you're requesting.  this is
supposed to be a string so it'll need to be in quotes.  my personal
preference is single-quotes so that's what i'll be using here.

'page.asp?id=intID',

the next argument is the name of the window.  this is the same thing as
opening a new browser window with the target attribute.  this is a string
and therefore must be wrapped in quotes.

'newWin',

the final argument is a comma-delimited list of the browser chrome you want
turned off and on.  there's a shortcut when using this that permits you to
simply list the names of the features you want on and leave off the ones you
don't want on.  using the window you were trying to create as an example,
here's what that argument would look like:

'resizable,width=385,height=295'

i would recommend also using top/screenY, left/screenX to place the window
on the screen where you want it rather than wherever it happens to open up.

'resizable,width=385,height=295,top=50,left=50,screenX=50,screenY=50'

now, all you gotta do is close this off with a parenthesis and it will work.

);

the whole thing would look like this (watch wrap):

window.open('page.asp?id=intID', 'newWin',
'resizable,width=385,height=295,top=50,left=50,screenX=50,screenY=50');

netscape documentation on the open() method of the window object:
http://developer.netscape.com/docs/manuals/js/client/jsref/window.htm#120273
1

microsoft's documentation on the same:
http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/open_0.asp


good luck,

.jeff

name://jeff.howden
game://web.development
http://www.evolt.org/
mailto:jeff at members.evolt.org






More information about the thelist mailing list