Welcome to WebmasterWorld Guest from 107.20.34.173

Forum Moderators: open

Message Too Old, No Replies

window.event has no properties

Firefox window.event has no properties

     

john1000

2:16 pm on Dec 29, 2006 (gmt 0)

10+ Year Member



hi,

im busy with a simple script that uses javascript and works ok but it does give a javascript error in firefox web-developer.

its says...

window.event has no properties
line 23

and thats.....

Key = (document.layers)?e.which:window.event.keyCode;;

full part is :

document.onkeypress = keyhandler;
function keyhandler(e) {
Key = (document.layers)?e.which:window.event.keyCode;;
if( Key == 13 ¦¦ Key == 32){ //13 is ascii value for Enter key 32 is space
convertor9(); //call your function here
}

if( Key == 27 ¦¦ Key == 8 ){ //27 is ascii value for Escape key 8 = backspace
clearConverse(); //call your function here
}
}

can his be solved?

Fotiman

4:58 pm on Dec 29, 2006 (gmt 0)

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month




Key = (document.layers)?e.which:window.event.keyCode;;

Why are you checking document.layers? Get rid of that. Change it to this and see if it works:

Key = (e.which)?e.which:window.event.keyCode;

john1000

6:18 pm on Dec 29, 2006 (gmt 0)

10+ Year Member



i have no idea,it was part of the javascript....
but your right...it solved it....
thank you very much Fotiman :)
 

Featured Threads

Hot Threads This Week

Hot Threads This Month