The Problem

From time to time we've received mail about the HM script not working in Navigator 4.0 - 4.01a, the first three releases of Netscape's DHTML browser. The complaint was usually voiced as: "it tries to load the scripts and hangs." In all honesty, we attributed the behavior to "old support" and filed it.

We are now getting version 4 of the HM ready, so a check through all browser versions and platforms was mandatory.

Yes, the old versions of Navigator for Windows (fine on the Mac) indeed looked like they were trying to load the scripts to no avail. A little debug code and the problem was isolated.

The HM script itself, (hierMenus.js), does not pose any difficulties for the browsers. It is our conditional loading script that confuses them:

In all other versions, and in IE, the second document.write is executed after the SCRIPT in the first document.write has loaded. This is the expected behavior, and vital to our technique.

The old Navigator versions execute the second document.write immediately after the first document.write, while the first SCRIPT is still loading. Ouch! You can imagine the confusion for the script engine.

The Solution

Obviously the best way to load the two external scripts is without document.write: