Errata

Start Here! Learn JavaScript

Errata for Start Here! Learn JavaScript

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
PDF Page 5
In the second note (box)

On page 5, Chapter 1, where you says about DTD, there is a typo in the second paragraph in the second note.
It should be Visual Studio instead if "Virtual Studio."

Shaikh Wasim Kamran  Jan 17, 2014 
ePub Page 33
Chapte 5, page 33 (click-on.js example)

In the form validation section, the function theWorks does not work properly with jQuery 2.0.3 as it is written in the example (click-on.js) due to the removeProp() function.

The jQuery API states the following:
Note: Do not use this method to remove native properties such as checked, disabled, or selected. This will remove the property completely and, once removed, cannot be added again to element. Use .prop() to set these properties to false instead.
http://api.jquery.com/removeProp/

I altered my code to the following to cause "#works" to uncheck when one of the #toppings was unselected.

Secondly, wrapped the code in another if to validate that the code in function theWorks only executed while the value of the checked property for #works was undefined/unchecked.

function theWorks(elm) {
if ($('#works').prop("checked")) {
if (elm.val() == "works") {
$('#mush').prop("checked", "checked");
$('#peppers').prop("checked", "checked");
$('#sausage').prop("checked", "checked");
} else {
$('#works').prop("checked", false);
}
}
}

Anonymous  Aug 10, 2013