Javascript worked in NS4, doesnt work in NS6



Tech Evangelism Graveyard
English US
18 years ago
3 years ago


(Reporter: hein.vaneeden, Assigned: Doron Rosenberg (IBM))



(Whiteboard: [TOOL][HIERMENU], URL)



18 years ago
Have a Javascript1.2 script that gets executed correctly by Netscape Navigator
4.08 perfectly, but it doesnt get executed by NS6.

There are also no Javascript errors when running "javascript:"

Comment 1

18 years ago
JavaScript error: line
813: isFrames is not defined

On mouseover menuitems i get this error:
JavaScript error: line
444: isLoaded is not defined

On mouseout i get this:
JavaScript error: line
712: isLoaded is not defined

linux 2000120621

Comment 2

18 years ago
To see javascript errors go to Tasks->Tools->Javascript console.

The problem with this page is the browser sniffer page which is

    NS4 = (document.layers);
    IE4 = (document.all);
    ver4 = (NS4 || IE4);
    IE5 = (IE4 && navigator.appVersion.indexOf("5.")!=-1);
    isMac = (navigator.appVersion.indexOf("Mac") != -1);
    isMenu = (NS4 || (IE4 && !isMac) || (IE5 && isMac));

none of NS4, IE4 or IE5 will get set by Mozilla, and so isMenu will be false.

As far as I can see isFrames only gets set if isMenu is true.
If isMenu is false the heirMenu.js should not be included.
However, hierMenu.js is included.
The problem is that the following code is used to add the script file:

<!-- if (isMenu)
... Add hierMenu.js

If 'if (isMenu)' is after '<!--' and on the same line it is not processed
correctly, but if it is on a new line, then it is processed correctly.

IE5 and Netscape 4.75 handle this in exactly the same way, so maybe the
behaviour is correct, and the web site is incorrect.

Comment 3

18 years ago
Reporter, please verify that your javascript is ECMAscript compliant, and don't 
forget that an old browser sniffing will not recognize Mozilla's user agent. 
Javascript is the base of Mozilla, so it does work, that you can be sure. Your 
code has to be invalid somewhere.
Thank you,

Comment 4

18 years ago
Conor is right: the site uses outdated browser sniffing code. Because of this 
the constant "NS4" is false when using N6, and much of the code doesn't execute.

As Conor points out, because NS4 is false, isMenu is false, and as a 
consequence the constant isFrames never gets defined. That occurs 
in the following part of the given URL:

if (isMenu) {
  menuVersion = 3;
  menuWidth = 120;
  isFrames = false;    <<<<<<<<<<<<< this is where isFrames gets defined


Here is another example, from the "hierMenus.js" file:

function popUp(menuName,e){
        if (NS4 && NSresized) startIt();
        if (!isLoaded) return;
        linkEl = (NS4) ? : event.srcElement;
        if (clickStart) linkEl.onclick = popMenu;
        if (!beingCreated && !areCreated) startIt();
        linkEl.menuName = menuName;   
        if (!clickStart) popMenu(e);

Because NS4 is false the function StartIt() never gets called here.
But that is one place where the constant "isLoaded" is defined -
This leads to an error on the following line, line 444 in the error 
messages above from the JavaScript console...

Reassigning to the Evangelism component. See bug 50711 for more information
on this subject -
Assignee: rogerl → evangelism
Component: Javascript Engine → Evangelism
Ever confirmed: true
QA Contact: pschwartau → zach

Comment 5

18 years ago
Any opionions on this javascript not working as expected in Netscape 4, Mozilla
and IE

<!-- if (isMenu)
... Add hierMenu.js

Comment 6

18 years ago
But nows the question, where can reporter verify his javascript to be fully
ECMAcompliant? That would be the question of this reporter!
Note, ECMAcompliant JavaScript's are rather complicated, if you do not know
where to look for!

Friendly, HJ.

Comment 7

18 years ago
Reassigning evangelism bugs to
Assignee: evangelism → bclary


17 years ago
Assignee: bclary → doronr

Comment 8

17 years ago
site seems down atm
I first ran into this bug when our Web designer cut-n-pasted this code into a
page on our site.  This appears to be a pretty common problem.  It stems from
the widely-used javascript hierarchical menus at:

It is at the root of this bug, bug 50711, bug 74033, bug 60136 and possibly bug

It looks like to solve this, we will need to implement at least as much of
Layers as IE does, or define document.all and make sure that the IE version of
hierMenus works.

Is that do-able?  Or is there any other way to solve this other than
evangelizing all of the hundreds of sites that use this?

Comment 10

17 years ago
Please see for information
about how to handle hierMenu related issues.
Blocks: 85104
OS: Windows 2000 → All
Hardware: PC → All
Whiteboard: [TOOL][HIERMENU]

Comment 11

17 years ago
All Evangelism Bugs are now in the Product Tech Evangelism. See bug 86997 for
Component: Evangelism → US English
Product: Browser → Tech Evangelism
Version: other → unspecified

Comment 12

17 years ago
since the site has been down  for some time, markign fixed per bc
Last Resolved: 17 years ago
Resolution: --- → FIXED

Comment 13

17 years ago
it's dead, jim.
Product: Tech Evangelism → Tech Evangelism Graveyard
You need to log in before you can comment on or make changes to this bug.