Earlier in this chapter we learned about the Window.open() and Window.close() methods that open and close browser windows. As you'll recall, the first argument to the open() method specifies a URL to be loaded into the new window, or the empty string if the window should be blank. The second argument is the name for the window. In Navigator, this second argument is optional, but it is required by Internet Explorer 3.0.
The open() method also has an optional third argument that we haven't seen yet. This third argument is a string that contains a comma-separated list of "features" for the new window. These "features" specify whether the window will have a menu bar, whether it will display a toolbar, whether it will be resizable, and so on. The features may also specify what the width and height of the window will be. If you do not specify this third argument, you'll get a full-size window with all the standard features. If you do specify the argument, you get only the features you specify. For example, you could use a line like the following to open a 400x300 window with a location field and a status bar:
smallwin = window.open("", "small", "location,status,width=400,height=300");
One common reason to open new browser windows with reduced sizes and reduced feature sets is to create "dialog boxes" that are more complex than those available through alert() and related methods. Figure 12.2 shows such a "dialog box" in a small browser window.