Help: Javascript not working in Firefox "event not defined"

Discussion in 'Javascript' started by Wiseman, Jul 25, 2008.

  1. Wiseman

    Wiseman Guest

    Hello,

    I am making a web page and have included a JavaScript named crazy clock. The
    page displays fine in IE but not in Firefox. The event console says: "event
    is not defined" at line 143. According to notepad plus, line 143 is:

    ymouse =
    (ns)?evnt.pageY+ClockFromMouseY-(window.pageYOffset):event.y+ClockFromMouseY;

    And the whole function is:

    function Mouse(evnt){
    ymouse =
    (ns)?evnt.pageY+ClockFromMouseY-(window.pageYOffset):event.y+ClockFromMouseY;
    xmouse = (ns)?evnt.pageX+ClockFromMouseX:event.x+ClockFromMouseX;
    }

    I am new to javascript and would be grateful if somebody told me how to
    solve this problem.

    Regards.
     
    Wiseman, Jul 25, 2008
    #1
    1. Advertising

  2. Wiseman

    Henry Guest

    On Jul 25, 3:36 pm, Wiseman wrote:
    <snip>
    > ... "event is not defined" at line 143. According to
    > notepad plus, line 143 is:
    >
    > ymouse =
    > (ns)?evnt.pageY+ClockFromMouseY-(window.pageYOffset):event. ...

    <snip>

    It means that however the value of - ns - is defined its value is not
    a useful discriminator of web browsers. That is, it is still false on
    Friefox. A better subject for the test would be the - evnt - formal
    parameter, as that has a direct relationship with the ability to use
    an event object passed as an argument to the function.
     
    Henry, Jul 25, 2008
    #2
    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. Replies:
    2
    Views:
    1,485
    Adrienne Boswell
    Jan 10, 2007
  2. JB
    Replies:
    3
    Views:
    176
    Fred Oz
    Nov 7, 2004
  3. Replies:
    4
    Views:
    279
    Randy Webb
    Feb 18, 2006
  4. OriginalBrownster

    Javascript not working in Firefox

    OriginalBrownster, Sep 4, 2006, in forum: Javascript
    Replies:
    2
    Views:
    125
    OriginalBrownster
    Sep 4, 2006
  5. John Ca
    Replies:
    22
    Views:
    271
    Dr J R Stockton
    Oct 7, 2009
Loading...

Share This Page