Working in All Except Mozilla (Firefox)

  • Thread starter Roy Schestowitz
  • Start date
R

Roy Schestowitz

Here is a problem I have not managed to solve for months. I have some
JavaScript which works properly in all the browsers I have tried except
Mozilla, including Firefox 1.0.

In my menu that is located http://www.schestowitz.com/Frames/bar.htm I am
supposed to get text displayed when I hover over the images. In never comes
up though.

I can't see what is wrong. Even Konqueror handles it fine...

Thanks in advance,

Roy
 
M

mscir

Roy said:
Here is a problem I have not managed to solve for months. I have some
JavaScript which works properly in all the browsers I have tried except
Mozilla, including Firefox 1.0.

In my menu that is located http://www.schestowitz.com/Frames/bar.htm I am
supposed to get text displayed when I hover over the images. In never comes
up though.

function display_title(num) {
if (!document.layers && !document.all && !document.getElementById)
return;
var entry=new Array(13);
entry[0]="";
entry[1]="<FONT SIZE=4 COLOR=WHITE><B>H</B><FONT SIZE=2>ome";
entry[2]="<FONT SIZE=4 COLOR=WHITE><B>S</B><FONT SIZE=2>ite Map";
entry[3]="<FONT SIZE=4 COLOR=WHITE><B>M</B><FONT SIZE=2>ore...";
entry[4]="<FONT SIZE=4 COLOR=WHITE><B>W</B><FONT SIZE=2>eb Log";
disp = "<FONT SIZE=3 COLOR=WHITE>" + entry[num] + "</FONT>";
if (document.getElementById) {
document.getElementById('pendule').innerHTML = disp;
} else if (document.layers) {
document.layers.pendule.document.write(disp);
document.layers.pendule.document.close();
}
}
 
R

Roy Schestowitz

mscir said:
Roy said:
Here is a problem I have not managed to solve for months. I have some
JavaScript which works properly in all the browsers I have tried except
Mozilla, including Firefox 1.0.

In my menu that is located http://www.schestowitz.com/Frames/bar.htm I am
supposed to get text displayed when I hover over the images. In never
comes up though.

function display_title(num) {
if (!document.layers && !document.all && !document.getElementById)
return;
var entry=new Array(13);
entry[0]="";
entry[1]="<FONT SIZE=4 COLOR=WHITE><B>H</B><FONT SIZE=2>ome";
entry[2]="<FONT SIZE=4 COLOR=WHITE><B>S</B><FONT SIZE=2>ite Map";
entry[3]="<FONT SIZE=4 COLOR=WHITE><B>M</B><FONT SIZE=2>ore...";
entry[4]="<FONT SIZE=4 COLOR=WHITE><B>W</B><FONT SIZE=2>eb Log";
disp = "<FONT SIZE=3 COLOR=WHITE>" + entry[num] + "</FONT>";
if (document.getElementById) {
document.getElementById('pendule').innerHTML = disp;
} else if (document.layers) {
document.layers.pendule.document.write(disp);
document.layers.pendule.document.close();
}
}

Yes, and...?

I tried debugging it. For some reason, Mozilla gets an 'undefined' value for
document.layers and document.all.

At first I thought Mozilla disallows certain (non-secure) classes of Java,
but ever since I gave up...

Roy
 
S

Steve Pugh

I tried debugging it. For some reason, Mozilla gets an 'undefined' value for
document.layers and document.all.

Exactly. It doesn't support either the NN4 specific documen.layers nor
the IE4 (sbut supported for legacy reasons on IE5+ and Opera 7)
document.all
So the first line of your script
if (!document.layers && !document.all) return;
tells Mozilla not to bother.

Get rid of document.all and document.layers and use proper DOM methods
such as getElementsById() instead. These will work in IE5+, Mozilla,
Opera, Safari, etc. Dropping support for IE4 and NN4 is fine, it's
nearly 2005, and so what if these old browsers don't get a few
optional effects?
At first I thought Mozilla disallows certain (non-secure) classes of Java,
but ever since I gave up...

I don't see any Java on your page.

Steve
 
J

Jeffrey Silverman

Exactly. It doesn't support either the NN4 specific documen.layers nor the
IE4 (sbut supported for legacy reasons on IE5+ and Opera 7) document.all
So the first line of your script
if (!document.layers && !document.all) return; tells Mozilla not to
bother.

And Moz dropped this support like, three, maybe four years ago. i.e. (no
pun intended) this is nothing new. Methinks the OP is using an old old
old (at least in Web dev terms) source for his/her JavaScript code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top