i don't know what i'm going wrong -- my code works in safari, but not in firefox. i was wondering if someobdy could help me track down the problem.
i have a function which ought to split normal clicks from alt-clicks.. and process them differently. fine.
so i have something like
and a corresponding function
now this works just fine in safari, but in firefox window.event is always undefined. i.e. even if i do a simple function which does alert(window.event), it's undefined.
what's wrong with firefox and window events or what's wrong with me for using them?
all best,
tench
i have a function which ought to split normal clicks from alt-clicks.. and process them differently. fine.
so i have something like
Code:
<a onclick="check()">click me</a>
and a corresponding function
Code:
function check(evt) {
evt = (evt) ? evt : ((window.event) ? window.event : "")
if (evt) {
if (evt.altKey) {
//blah-blah
} else {
//blah-blah
}
}
}
now this works just fine in safari, but in firefox window.event is always undefined. i.e. even if i do a simple function which does alert(window.event), it's undefined.
what's wrong with firefox and window events or what's wrong with me for using them?
all best,
tench