Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0
This is the forum to discuss the Wrox book Professional JavaScript for Web Developers by Nicholas C. Zakas; ISBN: 9780764579080
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 17th, 2006, 03:30 AM
Registered User
 
Join Date: Mar 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default keydown/press

1) Chapter 9, p.284, "Keyboard events": the book states that both keydown and keypress events "occur repeatedly when key is held down".
However, with Mozilla (in Linux), I only see keypress events when holding down a key; for example, keyEventsExample2.htm (modified to print each event in one line, skipping print of arrKeys when empty) outputs, when pressing "a" and holding:

>event is keydown: target is txtInput, keyCode is 65, charCode is 0
>event is keypress: target is txtInput, keyCode is 0, charCode is 97
>event is keypress: target is txtInput, keyCode is 0, charCode is 97
......
>event is keypress: target is txtInput, keyCode is 0, charCode is 97
>event is keyup: target is txtInput, keyCode is 65, charCode is 0

So it seems that only the keypress is repeated. A small point, but just in case there is a misunderstanding.

2) [Premise: I am reading this book with a previous limited experience in JavaScript]. In Chapter 6, "Checking the node type", p.169, I suddenly found a notation that was never presented before (varNode= ...), which looked similar to a Perl hash reference (replacing the "=>" with ":"). I then found on the web that it is indeed the JavaScript "associative array".
Perhaps, the data type could be added to the first chapters in the 2nd edition of the book (if I am right that it does not appear; I may have missed it, of course, given the amount of information).

(Remarkable book, by the way; what a methodic, colossal effort. I look forward to the next one on Ayax, after I complete this one).

raul
Reply With Quote
  #2 (permalink)  
Old March 17th, 2006, 09:34 AM
nzakas's Avatar
Wrox Author
 
Join Date: Dec 2004
Location: Peabody, MA, USA.
Posts: 217
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Hi Raul,

I'm glad you enjoyed the book. In regards to your comments, first, I'll have to look into the keypress/keydown event issue. At the time of my writing that book, Firefox 1.0 had just come out, and it's possible that subsequent versions altered the behavior.

For your second comment, that may be a good idea. The problem is that, technically, there is no "associative array" in JavaScript, only objects...which happen to act like associative arrays. But I understand your point, and perhaps the topic should be introduced earlier in the book. I have added this to my "wish list" for a second edition. :)

Nicholas


Nicholas C. Zakas
Author, Professional JavaScript for Web Developers (ISBN 0764579088)
http://www.nczonline.net/
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DatagridView Keydown Event senpark15 C# 0 June 28th, 2008 12:34 AM
C# Control.KeyDown Not Working 17beach C# 2 September 21st, 2006 02:40 AM
How to hijack backspace onkeypress (or keydown)? scubaduba Javascript How-To 1 November 8th, 2004 05:41 AM
Hi,HuhOic.(How to use keydown event) zhangxujun1981 C# 1 September 20th, 2004 07:17 PM
How to use KeyDown event in Form zhangxujun1981 C# 5 July 6th, 2004 02:07 AM



All times are GMT -4. The time now is 11:58 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.