Working in All Except Mozilla (Firefox)

Discussion in 'HTML' started by Roy Schestowitz, Dec 4, 2004.

  1. 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
     
    Roy Schestowitz, Dec 4, 2004
    #1
    1. Advertising

  2. Roy Schestowitz

    mscir Guest

    Roy Schestowitz wrote:

    > 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();
    }
    }
     
    mscir, Dec 4, 2004
    #2
    1. Advertising

  3. mscir wrote:

    > Roy Schestowitz wrote:
    >
    >> 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
     
    Roy Schestowitz, Dec 4, 2004
    #3
  4. Roy Schestowitz

    Steve Pugh Guest

    Roy Schestowitz <> wrote:
    >> Roy Schestowitz wrote:
    >>
    >>> 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 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
     
    Steve Pugh, Dec 4, 2004
    #4
  5. On Sat, 04 Dec 2004 11:11:52 +0000, Steve Pugh wrote:

    > 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.

    --
    Jeffrey Silverman

    ** Drop "PANTS" to reply by email
     
    Jeffrey Silverman, Dec 4, 2004
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Salerno
    Replies:
    20
    Views:
    881
    John Salerno
    Aug 11, 2006
  2. Fabio Z Tessitore

    who is simpler? try/except/else or try/except

    Fabio Z Tessitore, Aug 12, 2007, in forum: Python
    Replies:
    5
    Views:
    397
  3. David House

    try -> except -> else -> except?

    David House, Jul 6, 2009, in forum: Python
    Replies:
    2
    Views:
    364
    Bruno Desthuilliers
    Jul 6, 2009
  4. Peng Yu
    Replies:
    1
    Views:
    561
    Steven D'Aprano
    Nov 18, 2009
  5. MRAB
    Replies:
    0
    Views:
    873
Loading...

Share This Page