homepage Welcome to WebmasterWorld Guest from 54.197.65.82
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
window.event has no properties
Firefox window.event has no properties
john1000

5+ Year Member



 
Msg#: 3202819 posted 2:16 pm on Dec 29, 2006 (gmt 0)

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

WebmasterWorld Senior Member fotiman us a WebmasterWorld Top Contributor of All Time 5+ Year Member



 
Msg#: 3202819 posted 4:58 pm on Dec 29, 2006 (gmt 0)


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

5+ Year Member



 
Msg#: 3202819 posted 6:18 pm on Dec 29, 2006 (gmt 0)

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved