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


W

Wiseman

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

Advertisements

H

Henry

On Jul 25, 3:36 pm, Wiseman wrote:
... "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.
 

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

Top