How can I control the position of new browser windows createdwith the
window . open method?
In both scripting languages, the
window . open method takesthe following form:
window . open (URL
The first parameter is the URL of the document to be displayed in thenew window; the second parameter is the name of the new window (used forframe and window targets); and the third parameter is a quoted,comma-separated list of window features. (All three parameters arestrings.)
left” and “
top,” and they takethe form
where hpixels and vpixels are the horizontal andvertical pixel coordinates of the upper-left corner of the new window.
Thus, if you want your JScript program to open a 400×200-pixel windowin the upper-left corner of the user’s screen, you can do it inInternet Explorer with the following code:
window . open (location, name,"top=0,left=0,width=400,height=200");
Because Netscape Navigator simply ignores unrecognizedfeatures in the window features list, it is probably safe to use
top regardless of your “targetbrowser audience.” In fact, since there is a pretty good chance thatfuture versions of Netscape will support these features, itprobably won’t hurt to begin using them now. Remember, however, that atpresent they only work in Internet Explorer.