Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.mixmin.net!feed.xsnews.nl!border-1.ams.xsnews.nl!xlned.com!feeder5.xlned.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <9717015.O9o76ZdvQC@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Thu, 21 Jun 2012 20:08:20 +0200 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 8Bit X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. <1598379.oMNUckLgyt@PointedEars.de> Followup-To: comp.lang.javascript MIME-Version: 1.0 Lines: 55 NNTP-Posting-Date: 21 Jun 2012 20:08:20 CEST NNTP-Posting-Host: aa01b862.newsspool1.arcor-online.net X-Trace: DXC=eFRUf?SI0a9d8Nb@@ZG@b=ic==]BZ:af>4Fo<]lROoR1nkgeX?EC@@0g^WmZX^PGj3DZm8W4\YJNK0fQ>EOE\[m`;9[8665RZJ84 X-Complaints-To: usenet-abuse@arcor.de Xref: csiph.com comp.lang.javascript:14603 Phil Hunt wrote: > "basic DOM knowledge" and then "most difficult tasks in DOM programming" > ??? > Which one is it ? Both. Keyboard events are part of basic DOM knowledge indeed, but it is very difficult to make use of them because there are so many different implementations. > I mostly pretend to do .net asp, but I just need this jscript this time ^^^^^^^ You should have said so from the start. Microsoft's implementation of ECMAScript is called JScript, BTW (although at least in the MSDN Library they have jumped the "JavaScript" meme bandwagon recently), and it has little to do with the DOM implementation you are programming for, the MSHTML DOM. But from your code it looks as if that was not the end of it. > I google with 'event.keycode' to come up with > > { > if(window.event) // IE8 and earlier > { > keynum = e.keyCode; > } > else if(e.which) // IE9/Firefox/Chrome/Opera/Safari Ouch. Attributing different DOM behavior to different browsers (instead of different DOMs) – this is where misconceptions begin in this field. > { > keynum = e.which; > } This code could use a bit of Pretty Printing. > It works, that's all I know It works for some keys, but not others, to begin with. See the references I have provided. > "Thomas 'PointedEars' Lahn" wrote in message > news:1598379.oMNUckLgyt@PointedEars.de... >> […] Would you *please* stop top-posting? And please fix your From header field and skip the attribution novel while you are at it. PointedEars -- Prototype.js was written by people who don't know javascript for people who don't know javascript. People who don't know javascript are not the best source of advice on designing systems that use javascript. -- Richard Cornford, cljs,