Errata


Print Print Icon

Submit your own errata for this product.


The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.


Color Key: Serious Technical Mistake Minor Technical Mistake Language or formatting error Typo Question



Version Location Description Submitted By
Safari Books Online 24
Code

document.getElementById("rockImg").src does not work correctly.

An alternative is:

document.getElementById('rockImg').setAttribute("src", "rock_happy.png");

Daniel Hirschlein 
Printed Page 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 . . . "

Anonymous 
Printed Page 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

Anonymous 
Printed Page 59,73
Definition of placeOrder function

The placeOrder function takes an HTML form as an argument, but the placeOrder() declaration is missing the "form" should be:

placeOrder(form)

this mistake is on at least page 59, and 73, in the code samples included in the download, the code is correct.

Robert Porter 
PDF Page 62
The answer of 2nd question

"The good news it that it isn’t terribly difficult to ..." should be "The good news is that it isn’t terribly difficult to ..."

pcchee 
Printed Page 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.

Anonymous 
Printed Page 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.

Anonymous 
Printed Page 78
Code snippets between the arrows

parseInt("18") and parseInt("3 dozen") should be parseDonuts("18") and parseDonuts("3 dozen")

Kevin Sikes 
Printed Page 81
13th question of the puzzle

"13. An piece of data with an on/off value would be stored as this data type"

AN PIECE is not correct, as P is a consonant.

Cezar El-Nazli 
Printed Page 94
1st paragraph

Code for setTimeout() points to the following URL: "http://www.headfirstlabs.com/books/hfsd/" instead of
"../../hfjs/".

Anonymous 
Printed Page 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

Anonymous 
Printed Page 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.

Anonymous 
Printed Page 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?

Anonymous 
Printed Page 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 ]
}

Anonymous 
Printed Page 123
Cookie Example

Can't get any of your examples to write the cookie. Cookies are enabled.

Bill Slaughter 
Printed Page 140
last sentence

The last sentence ends with
...or sometimes even more that.
should probably be
...or sometimes even more than that.

Anonymous 
Safari Books Online 172
2nd paragraph under "Global Variable"

"your" is mis-typed as "you're"

Harry Spriggs 
Printed Page 201
top of 3rd column

I believe the word "inconventional" s/b "unconventional".

Anonymous 
Printed Page 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"

Anonymous 
Printed Page 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...

Anonymous 
Printed Page 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.");

Anonymous 
Printed Page 237
2nd paragraph

Under the second large paragraph with the seat# functions, <img id="seat14" src=" alt="" /> is missing a quotation mark under src=. It should be <img id="seat14" src="" alt="" /> instead.

Anonymous 
Printed Page 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.

Anonymous 
Printed Page 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..."

Anonymous 
Printed Page 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

Anonymous 
Printed Page 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:

<br/> to <br />

just to accommodate older browsers.

On page 300-302, the code

<input id="phone" name="phone" type="text" size="12" onblur="validateNonEmpty(this);"/>

there is no such space.

Anonymous 
Printed Page 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?

Anonymous 
Printed Page 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 "/dd/"?

Anonymous 
Printed Page 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.

Anonymous 
Printed Page 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) ?

Anonymous 
Printed Page 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?

Anonymous 
Printed Page 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.

Anonymous 
Printed Page 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.

Anonymous 
Printed Page 384
2nd paragraph?

I think this line on page 384 of H.F. java script:
decisionElem.appendChild("Decision 1 -> Scene 1 : Fork in the road."));

should be:
decisionElem.appendChild(document.createTextNode("Decision 1 -> Scene 1 : Fork in the road."));

The line in the book throws a "type mismatch" error.

Anonymous 
Printed Page 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?

Anonymous 
Printed Page 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,

Anonymous 
Printed Page 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:
<code>
var testVariable;
alert(testVariable);
</code>
the result is an alert-box with message-text 'undefined'

example for not defined:
<code>
alert(testVariable);
</code>
the result is a message in the error console:'testVariable is not defined'

Anonymous 
Printed Page 560
Bullet Points

The last Bullet Point appears to be truncated. All it says is "The send() method of the AjaxRequest object" ....

DJPJ 
Printed Page 560
Bullet Points box

Final bullet point is incomplete. "The send() method of the AjaxRequest object"

Anonymous 
Printed Page 568
top

Not sure if this has been mentioned(just joined forum).

Looking at the 'youcube13.html' code.

Do we need this code?:

// Set the blog-wide signature
Blog.prototype.signature = "by Puzzler Ruby";

Since we have added this code:

// Set the blog-wide signature
Blog.prototype.signature = "by " + getText(xmlData.getElementsByTagName("author")[0]);

We only need to extract the author's name from the 'blog.xml' file now(right?).

Jeff

Jeffrey Yee 


"For a lively, hands-on and memorable intro into JavaScript, Head First JavaScript is hard to beat. "
--Jacques Surveyer, Keep an Open Eye