10. In the HyperDoc Console, click MAIN to (re)open the primary browser window. Looks like magic, but it isn't. From this point on, IE and Communicator functionally part company. (IE users will still want to play along, though.) The code invoked by MAIN does a few different things.
var whoAmI = navigator.appName;
var bigKahuna = null;
function testBigKahuna() {
if (top.opener.blur) top.opener.focus();
else {
if (bigKahuna != null && bigKahuna.blur && whoAmI == "Netscape") bigKahuna.focus();
else {
bigKahuna = open("081398_jswin2.html#kahuna", "MainConsole", "toolbar, status, menubar, directories, location, resizable, scrollbars, height=440, width=640");
}
}
}
In Communicator, function first determines whether the (the primary browser window) is blurred (i.e., open). If so, the is brought to the top. If not, the function tests whether variable has a value (i.e., whether is an open window), is blurred, and whether the browser's name is . If these conditions exist, window is focused. If these conditions don't exist, a new window ( ) is launched.
In IE, focusing the works as it does in Communicator. If, however, the is closed, bypasses testing whether window is open and launches . So if is already open, it reloads. In IE 4.x, it's not possible for one link to both open or focus the same window.
Note: doesn't actually reopen the , instead it opens a new window with the file loaded.
11. In the HyperDoc Console, click SUPPORT.
Communicator brings the Novell Support Connection popup to the top without reloading it. IE reloads the window in the background (just as we saw with window ).
The code for focusing or opening the support window resides in frame :
var whoAmI = navigator.appName;
...
var secondSite = null;
function scryer(url) {
if (secondSite != null && secondSite.blur && whoAmI == "Netscape") secondSite.focus();
else {
secondSite = open(url, "w3Link", "scrollbars, top=20, left=20, height=280, width=620");
}
}
Now for the coup de grâce.
12. In the HyperDoc Console, click the close arrow graphic.
Both Communicator and IE close all three open HypderDoc windows. The code for doing this is discussed in part one of this article. Advanced JavaScript windowing -- part one: Self-closing popups For those who need a refresher, the code belowwhich resides in frame closes the support popup:
function disEngage() {
if (secondSite != null && secondSite.open) secondSite.close();
}
This next codewhich resides in the HyperDoc Console frameset filecloses the Topic Console:
function disEngage() {
if (devi8 != null && devi8.open) devi8.close();
}
For those less familiar with the placement of function definitions and invocations (or if I've been too abstruse), here are links to the HyperDoc 1.5 source files that contain JavaScript windowing code:
As JavaScript (and the IE permutation JScript) continues to evolve, developers will discover more resourceful ways to implement robust multi-window Web sites. This two-part article has only scratched the surface of possibilities. Well-architected windowed UIs let users rapidly access information and escape the time-sucking entanglement of convoluted Web design. Brent Lee Metcalfe is a corporate information architect for Novell Inc. Among other things, he designed and engineered the Web-based documentation user interface for several Novell® products, including Novell BorderManager, Z.E.N.works, and forthcoming NetWare® 5.0. Brent has published in c|net's builder.com, and he runs im@go w3 design in his spare time (whatever that is!). He can be pestered here or there. Portions Copyright © 1998 Novell Inc. All rights reserved. Used with permission.