Product Overview
The JavaScript Anthology: 101 Essential Tips, Tricks & Hacks
Corrections & Typos
Found a mistake that’s not listed here? You clever monkey! Contact us to let us know!
- No known errors at this time
Confirmed typos in the December 2006 reprint:
- p.9 2nd code listing
Both calls tochangeBordershould passthisas their first argument. - p.41 4th paragraph
In fact,isNaNwill returntruefor any value that cannot be converted to a number. - p.98 code listing
inputs.getAttributeshould beinputs[i].getAttribute. - p.119 code listing
The spaces before the $ characters in the regular expressions should be removed. For example:
should be/(^| )checkRequired( | $)/
./(^| )checkRequired( |$)/ - p.232 last paragraph
mybuttonshould bemylink. - Chapter 15 examples
You may find the vertical and horizontal drop down menus don't work as expected in IE7. The book was originally published before IE7 was released but the author, James Edwards, has supplied this CSS fix for the vertical menu:
/* 20080221: new hacks for IE7 */ *+html ul.vertical li { display: inline; float: left; background: #fff; } *+html ul.vertical li { position: static; } *+html ul.vertical a { position: relative; }Here's the fix for the horizontal menu
/* 20080221: new hacks for IE7 */ *+html ul.horizontal li { display: inline; float: left; background: #fff; } *+html ul.horizontal li { position: static; } *+html ul.horizontal a { position: relative; }
Confirmed typos in the August 2006 reprint:
- p.92 code listing
Both occurrences ofparagraphNodeshould beparagraph.
Confirmed typos in the February 2006 First Edition:
- p.7 paragraphs 2 and 3
The phrases "The above approach..." and "This scripting approach..." relate to the code listing on the previous page, not the one on this page. - p.15 code listing 2
There is a missing}following line 9 (documentAddEventListener...). - p.37 code listing 1
There shouldn't be quotes around10on the first line. - p.53 paragraph 5
b[0]thoughb[4]should bed[0]thoughd[4]. - p.83 paragraph 3
anchorArray[0]throughanchorArray[3]should beanchors[0]throughanchors[3]. - p.138 code listing 1
The firstelse ifline should also check ifscrollLeftis greater than zero:else if (typeof document.documentElement.scrollTop != 'undefined' && (document.documentElement.scrollTop > 0 || document.documentElement.scrollLeft > 0)) { - p.198 code listing 1
else if (agent.indexOf("mac"))should beelse if (agent.indexOf("mac") != -1). - p.232 paragraph 1
button.onclickshould bemylink.onclick.
ebook only
Instant Download!
This title available in Adobe PDF, Kindle (mobi) and ePub (IOS) formats
