...

View Full Version : error in FF



svibuk
05-30-2009, 12:26 PM
i am using
var evt = evt || window.event; // event object
var targ = evt.target || window.event.srcElement; // event target

but still getting error in FF
Error: evt is undefined
Line: 101

vwphillips
05-30-2009, 12:56 PM
var evt=window.event||arguments.callee.caller.arguments[0];
var obj=window.event?evt.srcElement:evt.target;

A1ien51
05-30-2009, 12:57 PM
function foo(evt){ <-- do you have evt here?

Eric

Philip M
05-30-2009, 01:02 PM
<script type = "text/Javascript">

function handleKeyPress(evt) {
var x = (window.event)?event.keyCode:evt.which;
alert (x);
return true;
}
document.onkeydown= handleKeyPress
</script>

digital-ether
05-31-2009, 05:45 AM
i am using
var evt = evt || window.event; // event object
var targ = evt.target || window.event.srcElement; // event target

but still getting error in FF
Error: evt is undefined
Line: 101

If you are already passing evt into the function, then:


var evt = evt || window.event; // event object

would make evt null.

The "var evt" makes "evt" null.

So you need:


evt = evt || window.event; // event object

this make sure evt is not set to null before being evaluated after the "=".

Notice that "var" is removed.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum