Errata

Head First HTML5 Programming

Errata for Head First HTML5 Programming

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 Note Update

Version Location Description Submitted by Date submitted
Printed Page 48
Snippet 4 first line

scoop++ should be scoops++, infinite loop otherwise and a hell of a lot of ice cream!

Dave Amour  Aug 16, 2016 
Printed Page 72-73
Step 3 incorrect. Step 5 duplicates step 6

Printed Edition, pages 72-73:

The sequence of 6 steps for the "Phrase-o-Matic" example is missing a key step and steps 5 and 6 are duplicated.

The existing step 5 should be replaced by the text of step 4. (This eliminates the duplication with step 6 on page 73.)

The existing step 4 should be replaced by the existing step 3.

The NEW step 3 on page 72 should be an illustration/explanation of the Math.floor() and Math.random() functions.

For example:
"Now, we get three random integers that are used to access the array elements in words1, words2 and words3 and assign them to three new variables, rand1, rand2 and rand3... " (Add additional detail for this step as appropriate.)

Gordon Schultz  Aug 23, 2018 
Printed Page 101
on the page overall

Given that it is not uncommon for people to hit 'enter' when filling out a form online, you might want to include some kind of warning that doing so instead of actually clicking the button will not give the desired results. I thought the code was broken because I hit enter reflexively and the test text I had typed to add to the playlist had disappeared.

Kimberly Copeland  Jun 30, 2016 
Other Digital Version 101
top of page code segment

In the book the author says to write this code:

function handleButtonClick() {

code here...
}

However, in the downloadable of this code, the event handler event called "e" is passed in as an argument to handleButtonClick().

The reason I say this is a serious technical issue is that the code will not run without this event e, and so beginning JavaScript coders will not recognize they need to provide this. Adobe DreamWeaver CC does not prompt that this is an error, so it took us hours to find!

Bill Heldman  Dec 08, 2016 
106
top

I wasn't able to determine a page since I am using my IPAD to access the SafariBooksOnline app.

The pictures in the book show the "addButton" as having rounded edges, but I cannot find anything in Playlist.css that would round the corners.

I would appreciate a response to indicate that either I am missing the section that contains the proper CSS or the CSS that I should add to my Playlist.css file.

Thanks

Anonymous  Apr 13, 2017 
Printed Page 140
bottom paragraph

Detail error message is below. Basically this problem is the use of the alert command inside a javaScript routine. Alert is not native to javaScript but is part of window object provided by browsers. Since no reference to HTML was given with this code, it can be surmised that this was to be executed as native js. Using the console.log method in place of alert fixed the issue.

message:

Exited with error status 1

stderr:

/box/script.js:37 alert(nextShowing); ^ ReferenceError: alert is not defined at Object. (/box/script.js:37:1) at Module._compile (internal/modules/cjs/loader.js:959:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) at Module.load (internal/modules/cjs/loader.js:815:32) at Function.Module._load (internal/modules/cjs/loader.js:727:14) at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) at internal/main/run_main_module.js:17:11

Anonymous  Mar 14, 2023 
Printed Page 141
Testing at the drive-in

The text tells you to type in the code on the previous page and test it. Nothing happens if you do that. We're only in chapter 4, there should be a reminder, at the very least, that you need to set it as <script> in HTML5, or you could include the HTML5 that it needs to be added to in the source files for the book, but the only ones included are already complete, so I don't know what you expect us to type this code into to make it work. Also, you should probably more expressly mention that you have to also type in the movie objects from page 139, as the code references them.

Kimberly Copeland  Jun 30, 2016 
Printed Page 187
at the very bottom left

"Maps" in "Google maps" should be capitalized.

Cesare  Dec 21, 2015 
PDF Page 194
declaration of variable watchId

Why is watchId being assigned a null value ? NULL values are assigned to variable which are supposed to be holding an object in the future. So in this case, in my humble opinion watchId should be left as it is, with no assignment which gives it a default value of undefined.

Aseem  Nov 20, 2017 
Printed Page 251
Just above second box

Guru: ... rename dog3.js to sales.js....

http://www.wickedlysmart.com/hfhtml5/chapter6/dog3.js

Brings up the dog3.js script

while
http://www.wickedlysmart.com/hfhtml5/chapter6/sales.js

gives a 404 error

Russ Bain  Aug 27, 2016 
Printed Page 254
Brain Power

The URLs are no longer active.

each gives the error:

"{"errors":[{"message":"The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.","code":64}]});"

Russ Bain  Aug 27, 2016 
Printed Page 275
screenshot at the bottom

I need to replace the screenshot to remove the duplicate sale of gum balls (in Farmington). It isn't actually a duplicate, but looks like one which is confusing.

Elisabeth Robson  Oct 22, 2013 
Printed Page 322
Handwritten text, right above the highlighted code

Replace "this WILL GIVES us" with "this WILL GIVE us".

Cesare  Dec 23, 2015 
Printed Page 322
Twitter link

Hello,

I was build code about cap. 7 when i was need to make this script(page 322):

<script src="http://twitter.com/statuses/user_timeline/wickedsmartly.json?
callback=updateTweets">

After check in google i found some erradas and i tryied this link:

http://api.twitter.com/1/statuses/user_timeline.json?screen_name=wickedsmartly&callback=updateTweets

but i got this message:

/**/updateTweets({"errors":[{"message":"SSL is required","code":92}]});

Still same problem after install DigiCert SHA2 (https://dev.twitter.com/overview/api/tls)

The problem persist.
Could you help how can i finally finish my cap. 7?

Thanks for help!

Victor Freidinger  Apr 18, 2017 
PDF Page 323
In the updateTweets function

This line:

tweet = tweets[i];

Should be:

var tweet = tweets[i];

The code will work okay as it's currently written, but without the local var declaration 'tweet' becomes a global variable. Probably not what you want.

T. Graham  Sep 19, 2016 
PDF Page 334
Exercise

the canvas parameter in drawBird(canvas, context) is never used, and the function works with only context being as the parameter! You might want to explain this.

Aseem  Nov 28, 2017 
Printed Page 338
Top right, third bullet point

"A path is A invisible line"

should be

"A path is AN invisible line"

Cesare  Dec 23, 2015 
Printed Page 377
Code

I found it hard to understand what line of code passes the "e" parameter to the handler. It turns out, it's the browser. Also, the "target" property isn't explained in the book, is it?

I had to ask on StackOverflow for help:
http://stackoverflow.com/questions/34449927/passing-a-value-to-a-function-in-javascript

Cesare  Dec 24, 2015 
PDF Page 379
In the pushUnpushButtons function

This line:

if (!theClass.indexOf("selected") >= 0)

...always evalutes to true because the '!' operator takes precedence over the '>=' operator.

One fix would be to change the line to this:

if (!(theClass.indexOf("selected") >= 0))

But the code might be easier to understand by changing it to this:

if(theClass.indexOf("selected") == -1)

Sneaky bug :-)

T. Graham  Sep 22, 2016 
Printed Page 403
Speech bubble on the top

"Hey I know its almost"

should be

"Hey I know it's almost"

Cesare  Dec 27, 2015 
Printed Page 418
Next to the "exercise" image

"[...] To do that you should create a simple html page".

"html" should be upper-case: "HTML".

Cesare  Dec 27, 2015 
Printed Page 435
Code

I think there shouldn't be a "/" in the input element, should it?

<input type="button" id="clear_button" value="Clear storage" />

Notice the "/" at the end.

Cesare  Dec 28, 2015 
Printed Page 511
Code at the bottom

importScripts("workerlib.js");

should be

importScripts("mandellib.js");

Cesare  Jan 03, 2016 
Printed Page 512
Under "Close up on tasks"

"Well, it's an object made up of PROPETIES and values, let's take a look:"

should be:

"Well, it's an object made up of PROPERTIES and values, let's take a look:"

Cesare  Jan 03, 2016 
PDF, ePub, Mobi Page 12620
text

Typos:

Current Copy
David’s comments always result in signficant improvements to the text, and we sleep better at night knowing that if it’s been through David, then we’ve hit the technical mark.

Suggested
"David’s comments always result in signficant improvements to the text," should be "David’s comments always result in significant improvements to the text,"

Current Copy
To do that, we typically assign the element to a variable so we can refer to the element thoughout our code; let’s do that and then change the text: Sharpen your pencil Here’s a DOM with a secret message hidden in it.

Suggested
"variable so we can refer to the element thoughout our code; " should be "variable so we can refer to the element throughout our code; "

Current Copy
hourly temperatures: Or, if you’re really in a hurry, JavaScript gives you a shortcut to type in an array (what we call a “literal array”) to create and intialize it with values: Adding another item to the array At any time you can keep adding new items to your array simply by using the next, unused index,

Suggested
"(what we call a “literal array”) to create and intialize it with values:" should be "(what we call a “literal array”) to create and initialize it with values:"

Current Copy
Let’s take a quick peek under the covers to see its more interesting properties and methods: A closer look at document.getElementById We promised in the begining of this chapter that you’d understand document.getElementById by the end of the chapter.

Suggested
"A closer look at document.getElementById We promised in the begining of this chapter" should be "A closer look at document.getElementById We promised in the beginning of this chapter"


Current Copy
The orgin of this phrase has been hotly debated.

Suggested
"The orgin of this phrase has been hotly debated." should be "The origin of this phrase has been hotly debated."

Current Copy
Well, you could set timeout to 0, and if there is a result that passes the maximumAge test, great, here it is, otherwise the call will fail immedately and call your error handler (with an error code of TIMEOUT).

Suggested
"maximumAge test, great, here it is, otherwise the call will fail immedately " should be "maximumAge test, great, here it is, otherwise the call will fail immediately "


Current Copy
There’s one other thing to know about images: they don’t always load immediately, so you need to make sure that the image has fully loaded beford you draw it.

Suggested
"so you need to make sure that the image has fully loaded beford you draw it." should be "so you need to make sure that the image has fully loaded before you draw it."


Current Copy
anchor on the page: Or, we can do things that are much more complex: There’s a whole ‘nother side of jQuery that allows you to do interesting interface transfomations on your elements, like this: As you can see, there’s a lot you can do with jQuery, and we haven’t even talked about how we can use jQuery

Suggested
"interface transfomations on your elements, like this: " should be "interface transformations on your elements, like this: "


Current Copy
might be considering. In particular we’ve added a bunch of new new semantic elements that give you even more power to architect

Suggested
"In particular we’ve added a bunch of new new semantic elements" should be "In particular we’ve added a bunch of new semantic elements"

Anonymous  Sep 18, 2019