mil.se - Javascript menus not working

RESOLVED WORKSFORME

Status

P4
normal
RESOLVED WORKSFORME
17 years ago
3 years ago

People

(Reporter: daniel.perup, Unassigned)

Tracking

Details

(Whiteboard: [LAYER], URL)

(Reporter)

Description

17 years ago
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2) Gecko/20010630
BuildID:    

The menus at the top of the page http://www2.mil.se/?lang=eng 
("Contents", "Organization", "Other languages" and "Points of contact") should
display a drop down menu when clicked. As of now, the URL changes, but no menu
appears. The menus work as expected in Netscape 4.75.

A quick look at the html source suggests it might be a problem on their side
with detecting Netscape clients. 

Reproducible: Always

Steps to Reproduce:
1.Load the page http://www2.mil.se/?lang=eng
2.Click a menuitem at the top, for example "Contents".
3.Note that no drop down menu appears, but the URL adds an #.

Comment 1

17 years ago
daniel.perup@swipnet.se: you are correct; it is bad browser detection.
The HTML at the site uses this file to do browser-sniffing:

               http://www2.mil.se/layerLib.js

Specifically:


// Browser and OS detection
var ns, ie, mac, objRef;

var pageLoaded=false;

function initLayerLib() {
  if (document.all) ie=true; else ie=false;
  if (document.layers) ns=true; 
  else ns=false;
  if (navigator.userAgent.indexOf("Mac")>0) mac=true; else mac=false;
  //objRef=new Array();
  pageLoaded=true;
}


Notice that "ns" will evaluate to false in Mozilla, because 
layers are no longer supported. See bug 50711 for more info.
The rest of the JavaScript and HTML at the site is like this:


function showMenu(menunr) {
    if (allowOpen==true){   
        var tempMenu
            if (openMenu!= null){
                tempMenu = "meny" +openMenu
                        if (ie){
                          document.all[tempMenu].style.visibility = "hidden"
                        }
                        if (ns){
                          document[tempMenu].visibility = "hide"
                        }
            }

            openMenu = menunr
            tempMenu = "meny" +menunr

            if (ie){
                document.all[tempMenu].style.visibility = "visible"
            }
            if (ns){
                document[tempMenu].visibility  = "show"
            }
}



Since "ie" and "ns" both evaluate to false in Mozilla, 
none of this code executes -

Comment 2

17 years ago
Reassigning to Evangelism component - 
Assignee: rogerl → bclary
Status: UNCONFIRMED → NEW
Component: Javascript Engine → Evangelism
Ever confirmed: true
OS: Linux → All
QA Contact: pschwartau → zach
Hardware: PC → All

Updated

17 years ago
Summary: Javascript menus not working → [LAYER]Javascript menus not working

Comment 3

17 years ago
Using: M 0.9.2 Build Id: 2001062815

Another page with badly rendered javascript menus is:

http://www.wimbledon.com/scores/cmatch/11ws.html

Also true for every page on the www.wimbledon.com website. Problem with only one
menu item, "Interactive" on all pages.

After moving the mouse over the "Interactive" menu item, the menu refuses to go
away even when another item is clicked. This could be a mistake with the
rendering engine or the code, it works fine with IE. 

Comment 4

17 years ago
-> Intl team
Assignee: bclary → nitot
QA Contact: zach → momoi

Updated

17 years ago
Component: Evangelism → European
Product: Browser → Tech Evangelism
Version: other → unspecified

Comment 5

17 years ago
Moving to new component "West Europe".  European component is being removed. 
See bug 95808 for details.
Component: European → West Europe
QA Contact: momoi → caillon
Summary: [LAYER]Javascript menus not working → mil.se - Javascript menus not working
Whiteboard: [LAYER]

Comment 6

17 years ago
Put priority at 4.
NS 6.2 2001092905094.
Priority: -- → P4

Updated

17 years ago
Blocks: 113492

Updated

17 years ago
No longer blocks: 113492

Comment 7

17 years ago
http://www2.mil.se/meny.js

Fixed
Status: NEW → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED

Comment 8

17 years ago
Minor problem still exists:
When the popup menu is open, it will close if you move the mouse left, right, or
down; but if you move the mouse up, the menu does not close.
2002022703/WinXP
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Brant: that's because you need to leave the layer, not the menu entry. But, is
this really a cause to keep this bug open?
I think this should be marked as fixed too, anyone ?

Comment 11

16 years ago
Because the Contents and Point of Contact menus cover content although
minimally, I think it is valid.  If content was not covered, I would say fixed,
but since they cover content something should be done.
move...
Component: Europe: West → Other

Comment 13

15 years ago
other default owner
Assignee: nitot → other
Status: REOPENED → NEW
QA Contact: z-caillon-obsolete2 → other

Comment 14

15 years ago
I can't see the problem with the dropdown menu that's described in comment #8.
Camino 2003090802 Mac OS 10.1.5. Maybe they've fixed it?

Comment 15

15 years ago
Agree to comment #14. WFM on Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.4) Gecko/20030624. Time to close!

Updated

15 years ago
Status: NEW → RESOLVED
Last Resolved: 17 years ago15 years ago
Resolution: --- → WORKSFORME
Product: Tech Evangelism → Tech Evangelism Graveyard
You need to log in before you can comment on or make changes to this bug.