advertisement -- please support sponsors

keeping windows on top

After I have opened up a pop-up window, how can I make sure that it stays on top?

Netscape Communications has introduced several new features in JavaScript 3.0 that make it possible to control which window is on top when many are open: The window object now has an onBlur event handler and a focus method. Both of these features can be combined to make sure that a window will call its own focus method whenever it becomes blurred.

The following code illustrates how this can be done:



 <body onBlur="self . focus ();">


Try this code and see if it works on your browser!

Please note that although the onBlur event handler is specified within the <body> tag, it is actually associated with the window object, not the document object.

Detailed information about the window object's onBlur event handler and focus method can be found in Netscape Communication's JavaScript Authoring Guide.

Charlton Rose
2 Jan. 1997