Online Software Educational Training - IT Tutorials - Online Education Training for Computer Software


Home

JAVA SCRIPT

Window features

 

The third parameter of the window.open() method is a list of features that you'd like your window to have. As you've seen, if you don't include this parameter at all, the window will contain all the features of a default browser window.

However, if you specify any features in the third parameter, just those features will appear. The way to specify that you'd like your window to have certain features is to list them as a comma-separated list.

For example, if you write

window.open("some_url","window_name","location,menubar");

you'll get a window with just the location box (the place in your browser where you type in a URL) and a menu bar (File, Edit, etc.). Note that it's important that you don't put any spaces in the string. This will upset some browsers.

Another example is

window.open("some_url","window_name","location,height=100,width=100");

This will open a window that is 100 pixels high and 100 pixels wide and has no features other than a location field. Notice again that there are no spaces in the string.

Here's a list of the features that you can include in the feature string:

 

menubar
This is the row of functions that appears on most software applications. Normally it includes File, Edit, and a few other items.

 

status
This is the message bar at the bottom of your window. When you move your mouse over an HTML link, the URL appears in the status bar. You may have seen pages that use JavaScript to turn this status bar into a scrolling marquee. I'm not going to show you how to do this. If you want to know, you have to figure it out yourself. "Down with marquees," the monkey cried!

 

scrollbars
This allows scrollbars to appear when necessary.

 

resizable
If resizable is listed, the window can be resized. Be careful of the spelling. I always get it wrong.

 

width
The width of the window in pixels.

 

height
The height of the window in pixels.

 

toolbar
The browser toolbar, which contains the Back and Forward buttons, the Stop button, and the Home button, among others.

 

location
The text area of a browser into which you can type URLs.

 

directories
The directories that Netscape browsers have called "What's new," "What's cool," and so on.

 

Here are some examples of different type of windows.

Once you've checked out the examples, and maybe tried bringing up some windows of your own, it's time to learn how to mess with the contents of the windows.

<Previous                                                                                                      Next>