Why does this script work with IE and not with Firefox ?

Discussion in 'Javascript' started by benfbox-google@yahoo.fr, Jul 21, 2005.

  1. Guest

    Hi, there.

    The following javascript is working perfectly with IE, but does not
    work with Firefox (no error, but displays nothing).
    Can somebody help ?
    Thanks in advance,
    Ben.


    The script :

    Xoffset=-60;
    Yoffset=20;

    var nav,old,iex=(document.all),yyy=-1000;
    if(navigator.appName=="Netscape"){(document.layers)?nav=true:eek:ld=true;}

    if(!old){
    var skn=(nav)?document.dek:dek.style;
    if(nav)document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove=get_mouse;
    }

    function show_popup(msg1,msg2){
    var content="<TABLE WIDTH=150 BORDER=1 BORDERCOLOR=black CELLPADDING=2
    CELLSPACING=0 BGCOLOR='#999999'><TD ALIGN=center><FONT COLOR=white
    SIZE=3><I>"+msg1+"</I></FONT><BR><FONT COLOR=white
    SIZE=2><I>"+msg2+"</I></FONT></TD></TABLE>";
    if(old){alert(msg);return;}
    else{yyy=Yoffset;

    if(nav){skn.document.write(content);skn.document.close();skn.visibility="visible"}

    if(iex){document.all("dek").innerHTML=content;skn.visibility="visible"}
    }
    }

    function get_mouse(e){
    var
    x=(nav)?e.pageX:event.x+document.body.scrollLeft;skn.left=x+Xoffset;
    var y=(nav)?e.pageY:event.y+document.body.scrollTop;skn.top=y+yyy;
    }

    function kill_popup(){
    if(!old){yyy=-1000;skn.visibility="hidden";}
    }



    and the calling Html :

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1">
    <TITLE>untitled</TITLE>
    </HEAD>

    <BODY BGCOLOR="#999999" LINK="#0000FF" VLINK="#0000FF" ALINK="#0000FF">
    <SCRIPT LANGUAGE="javascript" src="../html/popup.js"></SCRIPT>

    <BR><BR><P ALIGN="CENTER"><FONT SIZE="8" COLOR="#336666">Photos en
    Couleurs</FONT></P><BR><BR>
    <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" ALIGN="CENTER"
    WIDTH="650">
    <TR>
    <TD ALIGN="CENTER"><A HREF="c_fleurs/c_fleurs.htm"><IMG
    SRC="c_fleurs/01s.jpg" BORDER="0"
    onMouseOver="show_popup('Fleurs','14.3.2005')";
    onMouseOut="kill_popup()"></A></TD>
    </TR>
    </TABLE>
    </BODY>
    </HTML>
     
    , Jul 21, 2005
    #1
    1. Advertising

  2. wrote:

    > The following javascript is working perfectly with IE, but does not
    > work with Firefox
    >
    > iex=(document.all)
    > if(navigator.appName=="Netscape"){(document.layers)


    http://www.mozilla.org/docs/web-developer/upgrade_2.html#dom

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
     
    David Dorward, Jul 21, 2005
    #2
    1. Advertising

  3. BenF Guest

    OK, thanks !

    Ben.
     
    BenF, Jul 22, 2005
    #3
    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. Horace Nunley

    why why why does function not work

    Horace Nunley, Sep 27, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    461
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Sep 27, 2006
  2. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    900
    Mark Rae
    Dec 21, 2006
  3. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,958
    Smokey Grindel
    Dec 2, 2006
  4. Mark Tarver

    why does this script not work?

    Mark Tarver, Dec 2, 2006, in forum: Perl Misc
    Replies:
    15
    Views:
    256
    Tad McClellan
    Dec 9, 2006
  5. darius

    why does this not work in firefox?

    darius, Feb 7, 2007, in forum: Javascript
    Replies:
    3
    Views:
    128
    the DtTvB
    Feb 8, 2007
Loading...

Share This Page