All users were logged out of Bugzilla on October 13th, 2018

dn.se - Some menus triggered on mouse over does not seem to work.

RESOLVED INCOMPLETE

Status

RESOLVED INCOMPLETE
16 years ago
4 years ago

People

(Reporter: jens.yllman, Unassigned)

Tracking

Details

(URL)

(Reporter)

Description

16 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3a) Gecko/20021203
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3a) Gecko/20021203

When looking on this page you will see a row containing the following.

Aktier>   Aktieprodukter>   Index>   Nyheter>

When you move your mouse over any of these words there should be a menu popping
up. But it does not.

Reproducible: Always

Steps to Reproduce:
1. Move mouse over any of the words.
2.
3.

Actual Results:  
Nothing

Expected Results:  
Menupopup

I'm no expert on this kind of JavaScrip code. So I'm not even sure it's the
JavaScript code or something else that is wrong. Or even if it is Mozilla that
fails or the code badly written. But I would like someone that knows this to
look at it. And if it is the code that is wrong I would like to know so I can
kick on the persons responsible for the code.

Comment 1

16 years ago
It looks like a tech evangelism bug :-)

Like document.all / document.layers use !

Page is calling a script.js menu, in which we can see :

"function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)
x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i>d.layers.length;i++)
x=MM_findObj(n,d.layers[i].document); return x;
}

function tmt_findObj(n){
	var x,t; if((n.indexOf("?"))>0&&parent.frames.length){t=n.split("?");
	x=eval("parent.frames['"+t[1]+"'].document.getElementById('"+t[0]+"')");
	}else{x=document.getElementById(n)}return x;
}

function MM_showHideLayers() { //v3.0A Modified by Al Sparber and Massimo Foti
for NN6 Compatibility
  var i,p,v,obj,args=MM_showHideLayers.arguments;if(document.getElementById){
   for (i=0; i<(args.length-2); i+=3){ obj=tmt_findObj(args[i]);v=args[i+2];
   v=(v=='show')?'visible':(v='hide')?'hidden':v;
   if(obj)obj.style.visibility=v;}} else{
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) {
v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }}"

So d.layers -> document.layers ?!

Comment 2

16 years ago
Frederic is correct. The site is is using the outdated version 3.0 of
the Macromedia Dreamweaver menu template, which is not W3C-compliant.
The site needs to upgrade to version 4.0 or higher.

Reassigning to Tech Evangelism so the site can be contacted -
Assignee: rogerl → nitot
Status: UNCONFIRMED → NEW
Component: JavaScript Engine → Europe: West
Ever confirmed: true
Product: Browser → Tech Evangelism
QA Contact: pschwartau → brantgurganus2001
Version: Trunk → unspecified

Comment 3

16 years ago
In particular, version 3.0 of the MM_findObj(), which is used
repeatedly by the other functions in the template, is not 
going to find anything in a W3C-compliant browser like Mozilla.

So even though the site upgraded MM_showHideLayers() for W3C, that
function still calls MM_findObj(), which has not been upgraded -

Comment 4

16 years ago
I've checked into this further. The site has made a number of changes
to try to make it W3C-compliant. However, I found a problem in their
browser-sniffing in http://bors.www.dn.se/script/clientscript.js:


var client = new browser();

if(client.isNS && client.version < 6)
{
  hide = "hide";
  show = "show";
}

function browser() 
{
  this.isIE = (navigator.appName == "Microsoft Internet Explorer" ? true :                                                                         
false);
  this.isNS = (navigator.appName == "Netscape" ? true : false);
  this.isMac = ((navigator.platform).indexOf("MacPPC") >= 0 ? true : false);
  this.version = null;

  var userAgent = navigator.userAgent;

  if(this.isIE)
    this.version = parseFloat(userAgent.substr(userAgent.indexOf("MSIE") + 4));
 
  if(this.isNS)
  {
    if(userAgent.indexOf("Netscape/7") != -1)
      this.version = parseFloat(userAgent.substr(userAgent.indexOf("Netscape/7")                            
+ 9));
    else if(userAgent.indexOf("Netscape6/") != -1)
      this.version = parseFloat(userAgent.substr(userAgent.indexOf("Netscape6/") 
+ 10));
    else if(userAgent.indexOf("Mozilla/") != -1)
      this.version = parseFloat(userAgent.substr(userAgent.indexOf("Mozilla/")
+ 8));
}

  return this;
}


In Mozilla, we fall into the last case, and |userAgent| is something
like "Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.3a) Gecko/20021127"

So when they move 8 characters ahead from the "M", they come up with "5"
as the version. This means that when Mozilla runs their site, the value
of |client.version| is 5 throughout all of their code.

This prevents a lot of the functions from behaving as they expect.(The 
W3C-compliant code seems to depend on |client.version| being 6 or higher).


Compare: the |userAgent| string from a Netscape browser is like this:
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20021127 
Netscape/7.0"

In this case, their code would find "7" as the version, which is
the value they would expect.

So they seem to have a misunderstanding of how to identify Mozilla
properly -
Summary: Some menus triggered on mouse over does not seem to work. → dn.se - Some menus triggered on mouse over does not seem to work.
move...
Component: Europe: West → Other

Comment 6

15 years ago
other default owner
Assignee: nitot → other
QA Contact: brantgurganus2001 → other

Comment 7

15 years ago
They seem to have change the Java script that tries to identify the browser. I
still don't think they do it correctly. But it works now with Mozilla 1.5.

Comment 8

8 years ago
INCOMPLETE due to lack of activity since the end of 2009.

If someone is willing to investigate the issues raised in this bug to determine whether they still exist, *and* work with the site in question to fix any existing issues, please feel free to re-open and assign to yourself.

Sorry for the bugspam; filter on "NO MORE PRE-2010 TE BUGS" to remove.
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → INCOMPLETE
Product: Tech Evangelism → Tech Evangelism Graveyard
You need to log in before you can comment on or make changes to this bug.