- Has a good explanation of reading and writing cookies and when to use the optional values
- Most code is appropriate for 7 year old browsers and may not work as expected in modern browsers
- The author doesn't understand the reasons for why to code things in certain ways
- A lot of the examples use a long end inefficient way when a much easier way exists
- Uses browser sensing to try to tell the difference between browsers for some of the examples
- Author doesn't know what words are reserved words in Javascript
- Second Edition Published 2007
- 490 page paperback
- Published by No Starch Press
- ISBN 1-59327-106-9
- Author Thau!
There are two ways to learn a language like Javascript. You can take lessons in Javascript (either in a classroom or from a book) or you can teach yourself by viewing other people's scripts and experimenting. If you use the first method then you learn how to write correct and efficient code. If you use the second method then you learn how to write code that does what you need but which isn't necessarily either the best way to do it or even the right way.
There is no real problem with either of these methods where you are just looking to get javascript to work on your web pages. The problem comes when someone who has learned Javascript using the second method decides to write a book on Javascript and "The Book of Javascript" is one such result. This book is just full of poor and outdated coding techniques such as:
- Surrounding all your inline Javascript inside HTML comments that will hide your script from Netscape 1, IE 1 and 2, modern systems using a database to generate your web pages, and web pages served as XHTML
- Doesn't understand the difference between local and global variables
- Uses the deprecated getYear() method instead of the Y2K compliant getFullYear()
- Doesn't understand the effect of returning true or false from code attached to an event handler
- Assumes you need DIVs added to your page to be able to use getElementById instead of just identifying the existing tags
- Uses wrong capitalization in event handlers in HTML and ignores event listeners completely
- Uses A HREF="#" where SPAN would be more appropriate
- DOM processing shows order where items are added one at a time instead of building the whole thing and adding it all at once
- Ajax code in the wrong order for IE7 so that IE7 ends up using the older less efficient method of sending to the server
- Lots of window processing examples that are blocked by modern browsers


