Head First JavaScript by Michael Morrison The unconfirmed error reports are from readers. They have not yet been approved or disproved by the author or editor and represent solely the opinion of the reader. Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem ?page-number?: reader question or request for clarification This page was updated July 17, 2008. UNCONFIRMED errors and comments from readers: (xxxii) 3rd Paragraph/3rd picture at top; Elaine Nelson's picture has Elaine Norman over it instead of Elaine Nelson (43) 3rd Paragraph of left column (Variable's dialogue); In third line of paragraph, the word "to" is repeated: " . . . when you've got to to store information . . . " (46) Watch it!; It is not made clear enough that constants are not supported by Internet Explorer. Use "var" instead of the "const" keyword in all code examples in chapter 2. (49) column 2, top question; Please delete the apostrophe in the word "it's"; it should be "its". (49) Bullet Points - 4th bullet; The word "keyboard" should be changed to "keyword". "The var keyboard is used to create variables, while const is used to create constants." {54} bottom; The caption beside the leftover magnets at the bottom of page 54 says, "All these leftovers are illegal names in JavaScript." But one of the magnets is named "eclairRECORDHOLDER". While this name does not conform to the unofficial standards, it certainly is legal. {59} middle of sample code; the placeOrder function should take in the form object as a parameter in order for the form.submit() to work.... same error as pages 73 and 74 {71} first paragraph; CURRENT: The key to accessing a web page element with JavaScript is the id attribute of the HTML tag. REVISED: The key to accessing a web page element with JavaScript is the id attribute of the input tag. {73} start of sample code; The sample code on page 73 and 74 won't work because the form in "form.submit()" does not have a form object to work with. I think placeOrder should probably be getting the form object in as a parameter. (81) 13 Across; "An piece of data . . ." should be either "A piece of data . . ." or "Any piece of data . . ." (94) 1st paragraph; Code for setTimeout() points to the following URL: "http://www.headfirstlabs.com/books/hfsd/" instead of "../../hfjs/". (94) 1st paragraph 3rd line; Instead of ....headfirstlabs.com/books/hfsd it should read ....headfirstlabs.com/hfjs. (96) top; In the "Sharpen your pencil Solution" at the top of page 96, the comment about the millisecond calculation says, "The five-minute delay is calculated in milliseconds by first converting to minutes (x60) and then ...." Here, "minutes" should be replaced by "seconds," since multiplying by 60 converts from minutes to seconds. {103} first 'arrow' annotation to illustration; example shows the property to get the height of the client window to be clientWindowHeight - it should be clientHeight. [104] Sample code; I think the code for resizing the rock should work in XHTML compliant pages or it shouldn't be in the book since people can't use it in the real world. It just doesn't make sense to have code there that won't work in a 'real' web page. Can you modify it or change the example? {122}Code Way Up Close; In the touchRock function, the operation of getting the userName first is missing. function touchRock() { userName = readCookie("irock_username"); [ Rest of code is correct ] } (140)last sentence; The last sentence ends with ...or sometimes even more that. should probably be ...or sometimes even more than that. {170} middle of sample code; there is a semi-colon missing after the curScene = 2 in the middle of the sample code. (201)top of 3rd column; I believe the word "inconventional" s/b "unconventional". (217)2nd paragraph; The sentence ...it's worth making changes to your code so that is more "elegant" s/b ...it's worth making changes to your code so that it is more "elegant" (226)2nd to last sentence on page; The sentence - I am aware that there are lot of different... s/b I am aware that there are a lot of different... (234) sharpen your pencil solution; In the fourth line of the solution the variables i and j need to be switched, right now it says: alert ("seat " + i + "in row " + j + "is available."); it should say alert ("seat " + j + "in row " + i + "is available."); {237}2nd paragraph; Under the second large paragraph with the seat# functions, is missing a quotation mark under src=. It should be instead. (261)Sidenote pointing to thermostat picture; The sentence The "current temperature" display lets users know the current temperature so that they can make adjust the heat with more accuracy. s/b The "current temperature" display lets users know the current temperature so that they can adjust the heat with more accuracy. (274) There are no Dumb Question. Answer #3 in the 2nd paragraph; Original text "So when you assign a function to an event handler, as you do in a moment..." Correction "So when you assign a function to an event handler, as you will do in a moment..." (295)Title at the top of the page; the title Form field follow a chain of events s/b Form fields follow a chain of events {300} highlighted code; I'm not sure if you would consider this a mistake. I think that I read in the XHTML Head First that there should probably be a space between the /> and everything preceding it in an empty tag. Like this:
to
just to accommodate older browsers. On page 300-302, the code there is no such space. {309} Second question on left; Perhaps I am misunderstanding this, but on page 309 it says "The purpose of this.form in the Bannerocity code is to gain access to the help text element that is associated with a particular input field. Remember that this.form is a reference...." I understand the concept presented here but I don't see it being used, which confuses me as to why the text above implies that it is being used. If this method comes up in later pages, why not put this question after it comes up in the book? To me, it seems like it might confuse a reader who has never seen this before since it hasn't even been used in the book yet. What is being used is a document.getElementById('help_text_name') instead of a this.form["help_text"].... especially since the book mentions that the form approach is more concise but it doesn't seem to be using it? (321) to the right of the only paragraph on the page; there is a "/\d/" which is right of the paragraph. It points towards "catch22", but if it's pointing to that string..shouldn't the regular expression look like "/\d\d/"? {323} The "What's My Purpose?" activity; The list of terms you can choose from doesn't match the same order as the answer key on page 324 {336} the examples below the 2nd paragraph ; You give 2 examples of character classes, one is /d[iu]g/ and the other is /\$\d[\d\.]/ . Shouldn't that second example be /\$d[\.\d]/? The difference is between the brackets. {338} "Sharpen your pencil Solution", second answer; On page 338, the answer key shows the answer is return validateRegEx ( /^[\w\.-_/+]+@[\w_]+(\.\w{2,4})+$/..... but shouldn't it be validateRegEx (/^[\w\.-_/+]+@[\w_]+[\.\w{2,4}]+$/..... (using brackets instead of parentheses for testing the domain suffix) ? (339) 1 across; The crossword clue asks for the JavaScript object that supports regular expressions and the answer is given as regexp but surely it should be regex? {373} style tag found on the right side of the page; font-color should just be color. font-color is not a valid css property. {384} Second code sample; I think the second code sample should actually be this: decisionElem.appendChild(document.createTextNode("Decision 1 -> Scene 1: Fork in the road.")); it is currently missing the createTextNode portion. {434} in picture as well as code on bottom exercise; The ceiling function doesn't work in either Firefox or IE. Is it in this version of the standard? (488)First sentence of last paragraph; The sentence Safari points out that the error is on entirely different line of code, s/b Safari points out that the error is on an entirely different line of code, {497}1st paragraph; I think that's not correct that 'undefined' and 'not defined' mean exactly the same thing. 'not defined' means, that the variable does not exists/has not been created. 'undefined' means an undefined state, the variable exists/has been created but it's not initialized (no value has been assigned to the variable) example for undefined: var testVariable; alert(testVariable); the result is an alert-box with message-text 'undefined' example for not defined: alert(testVariable); the result is a message in the error console:'testVariable is not defined'