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. 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
Page 16
point 8

On page 16, topic 8 it's explained how to run a webpage however this doesn't work. Instead of running you get an error : Unable to start program 'http://localhost:52780/index.html The system cannot find the file specified Searching the web it seems to be an issue for which there's no solution unless using another default browser. Would be good if it can be explained how to get this working as described in the book (so this means with IE) or what the best solution is atm until Microsof fixes the bug There's also more information here:

Note from the Author or Editor:
This does indeed appear to be an issue with the Release Candidate of Visual Studio 2012 (it was still called Visual Studio 11 when the book was being written) when using on Windows 8. Hopefully Microsoft will address the issue soon, though I'm not sure if it's related to Visual Studio or Windows 8. Using one of the workarounds in the link appears to fix the issue. I believe this only applies to the specific combination of the Visual Studio RC and the RTM version of Windows 8, since it obviously worked for me to take the screenshot. :-)

Tom  Aug 26, 2012 
Printed, PDF
Page 34
Chapter 2

Used isNan instead of isNaN in chapter 2 on page 34 under the Numbers section.

Note from the Author or Editor:
Thanks for the report. Change it to isNaN to correct this issue.

Anonymous  Sep 16, 2012 
Page 35
1rd paragraph

var myString = "Test String"; myString.length; // returns 10 returns 11 not 10

Mario  Apr 26, 2013 
Page 54
Second paragraph

" JavaScript everything except numbers, strings, Booleans, undefined, and null are objects." Aren't numbers and strings objects also? ------------------------------------------------------- P.52 "...we haven't discussed functions." Actually you start chapter 3 by discussing functions!

Note from the Author or Editor:
Actually, numbers and strings are not objects. There are Number and String wrapper objects to the primitive types but the data types are primitives. As to the "we haven't discussed functions" part, you're right. :-) We moved some sections around and that didn't get updated.

Anthony Grace  Dec 06, 2012 
Page 107
2nd Paragraph

If users downloaded the latest version of jQuery - 1.9x then the toggle method no longer works as described. Basically it just hides the #mover div. It was deprecated in 1.8. To do something similar using the click event $('#mover').click(function () { var toggle = $.data(this, 'clickToggle'); if (toggle) { $('.moveit').appendTo('#mover'); } else { $('.moveit').appendTo('#movedest'); } $.data(this, 'clickToggle', !toggle); }); .toggle(function, function, ... ) removed This is the "click an element to run the specified functions" signature of .toggle(). It should not be confused with the "change the visibility of an element" of .toggle() which is not deprecated. The former is being removed to reduce confusion and improve the potential for modularity in the library. The jQuery Migrate plugin can be used to restore the functionality.

Rob  Jan 23, 2013 
Printed, PDF, ePub, Mobi, Safari Books Online
Page 108
Preventing the Default Action

The first example in this section refers the code being in click.html and click.js. The code for this first example is in click2.html and click2.js. Steve

Steve Suehring
Dec 16, 2012 
Page 108
Exercise - step 6

change <script type="text/javascript" src="external.js"></script> with <script type="text/javascript" src="js/external.js"></script>

Mario  May 01, 2013 
Page 147
WebForm1.aspx example

In step three, you're asked to enter an str using vbscript. That line is missing a comma and should read: Dim str = "{ ""Temp"": """ & outputTemp & """, " & _ " ""TempType"": """ & outputTempType & """ " & _ "}"

Steve Suehring
Mar 29, 2013 
Printed, PDF, ePub, Mobi, Safari Books Online, Other Digital Version
Page 175
Space Travel Demo

The code for the space travel demo differs from that in the downloadable companion content. Specifically, the downloadable index.html for Chapter 7 needs to be changed to point to css/StyleSheet1.css. You'll also need the correct theme for jQuery UI. I used ui-lightness which needs to be in the css directory. That may differ depending on your jQuery UI version and theme. Finally, as pointed out in the book, space.js is the name of the JavaScript file for this demo and that's found in the js folder in the companion content. You'll need to change index.html to js/space.js to reflect that. Steve

Steve Suehring  Jun 13, 2013