Errata

Learning Web App Development

Errata for Learning Web App Development

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. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date submitted Date corrected
PDF
Page 19
Figure 1-12

It looks like you have the wrong graphic for Figure 1-12. This does not look like git repository commits, and instead looks like you mistakenly put in Figure 2-5 from page 34.

Note from the Author or Editor:
This is described here.

http://learningwebappdev.com/errata/chapter1/2014/03/16/fig-1-12-is-the-wrong-image.html

Jim Wiedman  Feb 16, 2014  Aug 01, 2014
ePub
Page 45
2nd paragraph

The second paragraph ("Add index.html and follow up ...") seems to be a recap of the immediately preceding steps. Is it meant as a summary? If so the language should be adjusted to make this clear.

It looks more like a portion of outline which was expanded upon and should have been deleted.

Note from the Author or Editor:
Being tracked here:

https://github.com/semmypurewal/LearningWebAppDev/issues/28

Ken Hommel  Apr 07, 2014  Aug 01, 2014
PDF, ePub
Page 47
United States

The reference to the lightbulb image returns a 404 error.


"You can download the lightbulb image from http://www.learningwe bappdev.com/lightbulb.png."

Note from the Author or Editor:
This is fixed now.

Jim Wiedman  Mar 01, 2014  Aug 01, 2014
PDF
Page 64
Section "Cascading Rules"

The class in the CSS is called p.selected, however the class applied to the p element in the actual HTML is called <p class="greeting">

Note from the Author or Editor:
This is definitely a mistake. p.selected should be p.greeting in this example.

I'm tracking this issue here:

https://github.com/semmypurewal/LearningWebAppDev/issues/64

Kasper Meyer  Oct 09, 2014 
PDF, Mobi
Page 68
CSS example

To avoid an horizontal scroll bar under "<main>" container the CSS rule "nav" require "overflow: hidden" or the CSS rule "nav p" require "width: 100px" . (Verified in Linux Firefox and Google Chrome.)

Note from the Author or Editor:
Triaged here:

https://github.com/semmypurewal/LearningWebAppDev/issues/26

Anonymous  Mar 15, 2014  Aug 01, 2014
PDF
Page 108
Code sample at end of page

"var $new_comment" appears twice, first as a variable declaration, second line of the snippet, and again inside the nested block where it's used -- but also as a declaration ("var" occurs in both places).

Note from the Author or Editor:
triaged and now being tracked here:

https://github.com/semmypurewal/LearningWebAppDev/issues/47

Ken Hommel  Apr 29, 2014  Aug 01, 2014
Printed
Page 113
2nd block of example code

"var $newUL = $("<ul>"); //create a new li element" should be:
"var $newUL = $("<ul>"); //create a new ul element"

Note from the Author or Editor:
This has been triaged as github issue #25

https://github.com/semmypurewal/LearningWebAppDev/issues/25

Nick Litwin  Apr 04, 2014  Aug 01, 2014
Printed
Page 116
Figure 4-7 at the top of the page

Figure 4-6 and Figure 4-7 have the same caption, but the caption no longer applies to Figure 4-7.

"The DOM, with an unconnected subtree that represents a ul element."

The subtree is now connected though, not unconnected, so if it followed the same pattern as the figure in which the p element was added, it might say:

"The DOM, after the ul subtree is added to main."

Note from the Author or Editor:
Triaged here:

https://github.com/semmypurewal/LearningWebAppDev/issues/27

Nick Litwin  Apr 04, 2014  Aug 01, 2014
PDF
Page 121
Code snipped, bottom of page

Just a note about communicating with new programmers: in the JavaScript code snippet, the test is "number >= 3". In the log message, the text is "The number is bigger than 3!". In fact, the number is bigger than or equal to 3.

Why not change the test so the test and the message mean the same thing?

Note from the Author or Editor:
Fixed for first ebook update.

Ken Hommel  Apr 30, 2014  Aug 01, 2014
PDF
Page 135
Code snipped, third block

In the block for activating the third tab, the line to set the tab active refers to the second tab. This:
$(".tabs a:nth-child(2) span").addClass("active");
should be:
$(".tabs a:nth-child(3) span").addClass("active");

Note from the Author or Editor:
Noted here:

http://learningwebappdev.com/errata/chapter4/2014/04/20/chapter-4-tab-functionality-typo.html

Ken Hommel  May 01, 2014  Aug 01, 2014
PDF
Page 136
Code snippet, first block (makeTabActive)

The block that demonstrates refactoring the code for activating each tab omits the line from the previous version for clearing the main content ("$("main .content").empty();").

This line reappears on p. 137.

Note from the Author or Editor:
triaged and being tracked here

https://github.com/semmypurewal/LearningWebAppDev/issues/48

Ken Hommel  May 01, 2014  Aug 01, 2014
PDF
Page 140
First code snippet

Missing semicolon at the end of the code sample.

Note from the Author or Editor:
Fixed for first ebook update.

Ken Hommel  May 02, 2014  Aug 01, 2014
PDF
Page 164
United States

On page 164 the text says to create a "to-dos.json" file but in the follow code on page 165 the call to getJSON passes "todos.json". However, I will completely concede that this could be due to the unfortunate positioning of "to-dos.json" straddling 2 lines.

Note from the Author or Editor:
This is definitely due to a poor printed line-break. In the original doc it's correct. I'll make sure we reformat the line-break in future printings.

Anonymous  Dec 08, 2014 
PDF
Page 170
Setting up a test bed, first para, second sentence

"and tests it" should be "and test it".

Note from the Author or Editor:
Fixed in git repository in update1 branch

Ken Hommel  May 12, 2014  Aug 01, 2014
PDF
Page 171
First code sample, second and third blocks

Why are there two definitions for the function "organizeByTags", one inside of main() and one before it? They have different function signatures; does JavaScript support polymorphism?

If the first version of this function is #1 and the second version is #2, then #1 has a formal parameter and #2 does not. I don't know JavaScript; I would expect that the call to "organizeByTags(toDoObjects)" (in main()) would cause the interpreter to call #1, because the function signatures match. It doesn't, it calls #2. I'm guessing that this is a result of scoping, and polymorphism either doesn't exist in JavaScript or doesn't work the way I expect.

In short, I think the first definition of organizeByTags is just an error, and should be omitted.

Note from the Author or Editor:
This is definitely an error and is now being tracked here:

https://github.com/semmypurewal/LearningWebAppDev/issues/46

Ken Hommel  May 12, 2014  Aug 01, 2014
Printed
Page 191
2nd Paragraph, last sentence

"The req.writeHead function creates the HTTP header that sets the attributes of the response, and the res.end function completes the response by adding "Hello World.""

In the example (and the code in server.js), it says res.writeHead, not req.writeHead.

Note from the Author or Editor:
being tracked here

https://github.com/semmypurewal/LearningWebAppDev/issues/29

Nick Litwin  Apr 09, 2014  Aug 01, 2014
Printed
Page 193
Last paragraph

The last sentence states: "Let's start by creating a new directory in our app directory called Express. Create a server.js file that looks like this:"

However, on the top of the previous page (192), it says the same thing: "Let's start by creating a new directory inside the app directory and call it Express." So, if we followed the directions, we would have already created that directory. The only difference would be that we will be changing the server.js file as it is on pages 192-193 to the how it is on page 194.

Note from the Author or Editor:
Being tracked here:

https://github.com/semmypurewal/LearningWebAppDev/issues/30

Nick Litwin  Apr 10, 2014  Aug 01, 2014
Printed
Page 194
Second block of code, 3rd line

Missing an ending parenthesis:

from
app.use(express.static(__dirname + "/client");
to
app.use(express.static(__dirname + "/client"));

Note from the Author or Editor:
being tracked here:

https://github.com/semmypurewal/LearningWebAppDev/issues/31

Nick Litwin  Apr 10, 2014  Aug 01, 2014
PDF
Page 196
1st para

The text refers to the "Consumer key" and "Consumer secret". The terms on the Twitter app page are "API key" and "API secret". Similarly, the text refers to "access_token_key" while the Twitter app page uses "Access token" (the text refers to "Access token" and "access_token_key" but it isn't clear these are the same value).

The names for these attributes seem to be set by ntwitter, but it might be useful for readers if there were an explanation aligning the Twitter App page names and the ntwitter names.

Note from the Author or Editor:
This is clarified here:

http://learningwebappdev.com/errata/chapter6/2014/06/07/chapter-6-Twitter-API-changes.html

Ken Hommel  May 19, 2014  Aug 01, 2014
PDF
Page 197
3rd para

In the instructions for installing ntwitter, at the step for verifying the installation, should the command be "ls ../node_modules" and not "ls node_modules"? At that point the user is in the Twitter directory, but the module directory is one level removed.

Note from the Author or Editor:
This is an error. The node_modules directory will be in the same directory as the project's package.json, and since we didn't create a package.json file in the Twitter directory, the module will be installed one place above.

Since this doesn't directly affect the narrative, I've removed the ls command from the example in the first ebook update.

Ken Hommel  May 19, 2014  Aug 01, 2014
Printed
Page 200
if statement in large code block

The code "as is" on page 200 produces an error. Since tweet is an object, we can't use tweet.indexOf. I got it to work by replacing it with tweet.text.indexOf, which is hinted at on page 199 under "Using the indexOf function to find words."

Note from the Author or Editor:
being tracked here

https://github.com/semmypurewal/LearningWebAppDev/issues/32

Nick Litwin  Apr 10, 2014  Aug 01, 2014
PDF
Page 201
United States

On page 201 you have:

We can copy this file (server.js) into our Twitter directory (the same one that contains
tweet_counter.js) and then modify it so that it imports our tweet counter module and
uses the counts that we’ve exported.

However once I have done this and run the server I get the following error:

module.js:340
throw err;
^
Error: Cannot find module 'express'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/vagrant/app/Twitter/server.js:1:77)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)


This is because at no point does the book say to copy/install the express module into app/Twitter/node_modules. At this point in the book we only have:

vagrant@precise32:~/app/Twitter/node_modules$ ls
ntwitter

Note from the Author or Editor:
This was definitely an oversight on my part. You'll need to type 'npm install express@3' before running the server to make this work. The errata is now being tracked here:

https://github.com/semmypurewal/LearningWebAppDev/issues/67

Anonymous  Jan 01, 2015 
Printed
Page 202-203
code blocks

The code throughout pages 202-203 refers to counts.json, but I don't think we ever created this file up to this point in the book. I tried to get the code at the top of 202 to work, but using node app, tweetCounts = require("./tweet_counter.js"), and app.get("/counts.json"...) all seemed like bits of the code that I couldn't reconcile. Were we supposed to come up with this on our own, or is there an explanation missing? Either way, I think a sentence or two to clear this up would benefit the reader.

Note from the Author or Editor:
Being tracked here:

https://github.com/semmypurewal/LearningWebAppDev/issues/33

Nick Litwin  Apr 11, 2014  Aug 01, 2014
PDF
Page 202
2nd code block

The text says to run the server from the app directory and the command line to run the server shows "vagrant $ node app.js". Should this be "node server.js", running server.js in the app directory?

Note from the Author or Editor:
This issue has been noted here: http://learningwebappdev.com/errata/chapter6/2014/04/12/chapter-6-express-version-4.html

It is fixed in the latest ebook update, which will be pushed soon!

Ken Hommel  May 20, 2014  Aug 01, 2014
Printed
Page 219, 221
function(stream) in code blocks

I believe the if statement shouldn't have the = in >=.
"if (tweet.text.indexOf("awesome") >= -1)"

This executes the if statement when we found awesome and when we didn't as well. The code back in chapter 6 does not have the =, too.

Note from the Author or Editor:
Being tracked here:

https://github.com/semmypurewal/LearningWebAppDev/issues/34

Nick Litwin  Apr 11, 2014  Aug 01, 2014