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



Version Location Description Submitted By Corrected
Printed Page xiii
middle of page

delete the extraneous "s" in front of "sMac OS X: The Missing Manual, Tiger Edition

Anonymous 
Printed Page printing history page
Copyright line listing Authors name

There's no space between Sawyer and McFarland

Anonymous 
Safari Books Online 6.4
first "tip"

Tip: Because the ready() function is used nearly anytime you add jQuery to a page, there's a shorthand way of writing it. You can remove the $(document).ready part, and just type this:

Missing content at end of this line!

Note from the Author or Editor:
$(function() {
// do something on document ready
});

Anonymous 
Printed Page 8
2nd paragraph

The word 'starting' is incorrectly spelled as 'sarting'.

Anonymous 
Printed Page 8
2nd paragraph

sarting <- wrong
startingh -< correct

Note from the Author or Editor:
2nd paragraph, last line on page 8 should be "starting on page 172."

Grega Leskovsek 
Printed Page 15
2nd last line

The word 'need' spelled as 'nee'.

Note from the Author or Editor:
2nd to last line The word 'need' spelled as 'nee'

Anonymous 
Printed Page 15
Last paragraph, third line down

ORIGINAL

..."download chapters, and find quick answers when you nee the most accurate, current information. Try it free at http://safari.oreilly.com"

SHOULD BE
..."download chapters, and find quick answers when you [[need]] the most accurate, current information. Try it free at http://safari.oreilly.com"

ERROR DESCRIPTION: "nee" should be need.

Black Star 
Printed Page 26
last paragraph

"...you'll need a text editor (see page 190 for recommendation..." should ready read: "see page 9"

Minor error, but thought point it out since I was visiting the site.

Note from the Author or Editor:
Should say "see page 9" NOT "see page 190"

Anonymous 
Printed Page 26
final paragraph

Copywrite 2008 - First Edition

Text editors are on page 9, not page 190 as printed.

Note from the Author or Editor:
last paragraph "(see page 190 for recommendations)" should read
"(see page 9 for recommendations)"

Anonymous 
Printed Page 26
Your First Javascript Program, first paragraph

Quoting from the book

"To get started, you'll need a text editor (see page 190 for recommendations)"

but if you give a look at page 190, there isn't any recommendation. (You can find informations about text editors on page 9 and 10.)

Note from the Author or Editor:
"To get started, you'll need a text editor (see page 190 for recommendations)"

should be page 9

Anonymous 
Printed Page 26
last paragraph from the bottom

The old printed " see page 190 for recommendations "

SHOULD BE :

" page 9 "

Willie Chan 
Printed Page 29
8th paragraph

The page opens and the words "Hello world!" appear below the blue headline (see Figure 1-3).

It is actually more of a red/maroon headline unless my monitor is completely off in calibration :P

Note from the Author or Editor:
Should read "below the red headline."

Anonymous 
Printed Page 31-32
End of 31 and middle of 32

by following the step by step the code should look like this:
<script type="text/javascript" src="../js/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('table.striped tr:even').addClass('even');
});
</script>

but you have it as
<script type="text/javascript" src="../js/jquery.js"></script>
<script type="text/javascript">
$(function() {
$('table.striped tr:even').addClass('even');
});
</script>

Note from the Author or Editor:
In step 7 code should be:

$(document).ready(function() {
$('table.striped tr:even').addClass('even');
});

Anonymous 
Printed Page 31
Code for #5.

On page 31, #5 says that the reader should type: $(document).ready(function() {. However, on the next page, when McFarland shows the reader what she should have typed, this line has changed to: $(function() {.

I understand that there are some points that McFarland will go into in detail later in the book, but as for this particular line, there is no explanation as to why "(document).ready" was taken out of the code (or as to why it was inserted in the first place).

Note from the Author or Editor:
page 32, step 7:

$(function() { should read
$(document).ready(function() {

Anonymous 
Printed Page 32
step 7

On page 31, in step 5, the text says to enter

$(document).ready(function)() {

On page 32, the summary of all the commands the user is supposed to have entered does not include that statement. It includes instead

$(function() {

Note from the Author or Editor:
$(document).ready(function() {
is functionally the same as $(function() {
so the code in either case would work.

However, we decided to use $(document).ready(function() throughout the book, because it was a bit more obvious what it does. The code on page 32 should say $(document).ready(function(){

Anonymous 
Printed Page 42
2nd column of the FAQ box, line 7

In the given example ("He said, "Hello\"") the second double-quote character (just before the word Hello) should be escaped as well: "He said, \"Hello\"".

Note from the Author or Editor:
2nd column of FAQ box, line should read
"He said, \"Hello\""
The double quotes before the word Hello should also be escaped like this: \"

Larry Lessmann 
Printed Page 42
FAQ box, top right paragraph

The 7th line includes this: "He said, "Hello.\"". Should not the \ come before the second " as in "He said, \"Hello."" ?

Note from the Author or Editor:
Sentence should read:
You could rewrite the above example like this: "He said, \"Hello.\""

Anonymous 
Printed Page 42
Side box, 2nd column, last para

The paragraph is about escaping quotes even when you don't have to, but the example doesn't show the unnecessary escaping:

For example, 'He said "Hello."'.

should be

For example, 'He said \"Hello.\"'.

Note: This is not the bug noted by others in the next to last paragraph.

Note from the Author or Editor:
page 42, box, second sentence of last paragraph of second column, should read:
For example, 'He said\"Hello.\"'.

Nik Zakrzewski 
Printed Page 42
FAQ box, top right paragraph, last line

word "isn't" has to have a forward slash before it: isn\'t.
should it not read
word "isn't" has to have a backward slash before it: isn\'t.

Gerhard Schmidt 
Printed Page 49
5th para

First sentence after heading "Combining Strings" says: "Combining two or more stings, etc." SB "strings".

Mark Wales 
Printed Page 63
para 1

Actual text: "The Push and Unshift commands return a value (see the Note on the previous page)"

Corrected text: "...(see the Note on page 55)"

assuming the intended reference is re returning values.

Nik Zakrzewski 
Printed Page 71
3rd paragraph

You state that javascript and css use the same comment syntax. Unfortunately, css does not support the "//" comment syntax. It only supports the /* ... */ syntax. See section 4.1.9 of the css2 specification.

Anonymous 
Printed Page 72
4th para, 1st line

7th word ("a") is superfluous

Note from the Author or Editor:
Sentence should read:
"For example, at the beginning of the jQuery library's JavaScript file, you'll find this comment:"

Anonymous 
Printed Page 89
Step #9

luckyNumber = parseInt(luckyNumber, 10);

What the heck is the '10' for? It's not repeated in step 10.

What do I win? A free copy of 2nd edition?

Note from the Author or Editor:
In step 10, line #3 should read:
luckyNumber = parseInt(luckyNumber, 10);

It will work without the '10' part, but the 10 is used as a precaution against accidentally translating a number to 'octal' form. The note on page 136 explains why.

Anonymous 
Printed Page 93-94
Script description on p93-94 incorrect for script on p93

The script

var days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
var counter = 0;
while (counter < days.length) {
document.write(days[counter] + ', ');
counter++;
}


The description says that this would be printed to the screen:
"the day of the week is written to the page (followed by a comma and a period)".

This is not true. No period is written to the page and another problem is that it writes:

"Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday, "

You wouldn't want a comma and a space after Sunday.

I can correct this for myself but it needs to be changed in the next printing.

Anonymous 
Printed Page 94
Figure 3-4

Current text: The final result of this script will be "Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday"

Actually, as written, the script will result in an extra ", " being concatenated at the end after Sunday that would need to be trimmed:

..."Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday, "

Nik Zakrzewski 
Printed Page 108
Top line

In the top line on page n 108, chapter 3, you changed the format of instructing us to type in data into our editor. On line one you say

3. Hit return and add a new line and type var questions=[.

Thus adding a period at the end of this sentence.

Previously you would have presented it this way;

3. Hit return and add a new line and type:
var questions=[

Notice no period. Upon checking the 3.3 complete, I discovered no period was to be..

BTW...this is the best instructional book on coding I have ever read, and I think that your instructions gave me the ability to pick out this mistake...

Note from the Author or Editor:
For step 3, on page 108, do NOT type the final period. Just type:
var questions=[

Anonymous 
Printed Page 123
Table 4-3

Character [^ ]

Towards the end of the description, it says that this is the same as \d when in fact it would be the same as \D, the exact opposite of what is stated in the book.

Change (the same as \d) to (the same as \D)

Also, on a separate note, when you go to http://missingmanuals.com/cds and click on J to find the JavaScript book, the JavaScript book has an incorrect heading. It reads CSS: The Missing Manual.

You might want to fix that.

Note from the Author or Editor:
Table 4-3 change description for [^ ] to

Any character except one in brackets. For example, [^aeiouAEIOU/ will match any character that isn't a vowel. [^0-9] matches any character that's not a number (the same as \D).

Anonymous 
Printed Page 123
Table 4-3, entry for [^ ]

[^0-9] is described as the same as \d, whereas it actually the same as \D

Anonymous 
Printed Page 129
para 2, list item 4

current text: [-\/ .] will match a hyphen, a backslash, a period, or a space character.

should be: ..., a forward slash,...

Nik Zakrzewski 
Printed Page 130
Figure 4-4

current figure: ((https?\:\/\/)|(\swww\.))\S*

should be: ((\bhttps?\:\/\/)|(\bwww\.))\S*

Nik Zakrzewski 
Printed Page 149
Steps 6 and 8

On page 149 you are missing the "else" part of the "if/else"statements which create the variables "fillMonth" in step 6 and "fillDate" in step 8.

Eliminating these from the step by step directions meant the explanation of what they do was also missing.

If I did not carefully proofread my code against the completed function, rather than the step-by-step instructions, I would not have been able to debug the code.

Note from the Author or Editor:
Code in steps 6 and 8 on page 149 is correct.
However, there are two mistaken blocks of code in final code listed in step 13 on page 151.
This is wrong:
if (realMonth<10) {
fillMonth = '0' + realMonth;
} else {
fillMonth = realMonth;
}

Should be:
var fillMonth=realMonth;
if (realMonth<10) {
fillMonth = '0' + realMonth;
}

Also this is wrong:
if (day<10) {
fillDate='0' + day;
} else {
fillDate=day;
}

should be
var fillDate=day;
if (day<10) {
fillDate='0' + day;
}

Anonymous 
Printed Page 149
Just before step 9

The step-by-step instructions do not include the line:

var fillDate = (day<10) ? '0' + day : day;

Therefore you have not given any explanation of what this line is supposed to do.

The script will run either with or without the line, but I would like to know what I am coding!

Thank you for your help.
Margie Lynch-Freshner

Note from the Author or Editor:
The code on page 151 mistakenly lists the following line:
var fillDate = (day<10) ? '0' + day : day;
This is not necc. and is shorthand method for achieving the same code in step 9 on page 149.

Anonymous 
Printed Page 151
Under step 13, "The Complete function should look like this:"

The complete dateString function on page 151 is wrong and does not match the complete_4.1.html example from www.sawmac.com/javascript.

It is missing the declaration of the fillMonth variable

var fillMonth

before the line that reads "if (realMonth<10) {".

It is also missing the declaration of the fillDate variable

var fillDate

before the line that reads "if (day<10) {"

Lastly the line that reads "var fillDate = (day<10) ? '0' + day : day;" can, I beleive, be removed. It is not explained in the text nor matches the example. If that is the intended way of declaring the fillDate variable, it at least needs to be moved higher in the function prior to the IF (day<10) statement, and the example would need changing to match it.

Additionally, with regards to the function summary on page 151 and the complete_4.1.html file from the supplemental materials, neither of these functions matches the technique explained on the previous pages 148-150. Any true beginners to javascript will probably be very confused when working with this example.

On Page 149 you declare the fillmonth vairable as follows:

var fillmonth = realMonth;

which eliminates the need to have the ELSE statement to account for months which are greater than 10. In the example and on page 151 you instead simply define fillmonth but then use the ELSE statement as follows:

var fillMonth
if (realMonth<10) {
fillMonth = '0' + realMonth;
}
else {
fillMonth = realMonth;

The same discrepancy is found with the fillDate variable. On page 149 you use the declaration

var fillDate=day;

but then in the example and on page 151 you use the ELSE statement:

var fillDate
if (day<10) {
fillDate='0' + day;
} else {
fillDate=day;
}

Note from the Author or Editor:
Step 13 on page 151. The complete function code should look like this:

function dateString(date,string) {

var year=date.getFullYear();
var month=date.getMonth();
var realMonth=month+1;
var fillMonth=realMonth;
if (realMonth<10) {
fillMonth = '0' + realMonth;
}
var months = ['January','February','March','April','May',
'June','July','August','September',
'October','November','December'];
var monthName=months[month];
var day=date.getDate();
var fillDate=day;
if (day<10) {
fillDate='0' + day;
}
var weekday=date.getDay();
var weekdays = ['Sunday','Monday','Tuesday','Wednesday',
'Thursday','Friday','Saturday'];
var dayName=weekdays[weekday];
string = string.replace(/%Y/g,year); // 2008
string = string.replace(/%y/g,year.toString().slice(-2)); //08
string = string.replace(/%M/g,monthName); //January
string = string.replace(/%m/g,monthName.slice(0,3)); //Jan
string = string.replace(/%N/g,fillMonth); // 01
string = string.replace(/%n/g,realMonth); // 1
string = string.replace(/%W/g,dayName); //Monday
string = string.replace(/%w/g,dayName.slice(0,3)); //Mon
string = string.replace(/%D/g,fillDate); //05
string = string.replace(/%d/g,day); // 5
return string;
}

Anonymous 
Printed Page 161
End of 2nd paragraph

The two text nodes are "Some" and "text", not "Some" and "strong".

Note from the Author or Editor:
Last sentence of paragraph two should read:

Nodes that share the same parent, like the two text nodes--"Some" and "text"--and the <strong> tag are like brothers and sisters, so they're called siblings.

Larry Lessmann 
Printed Page 184
At the very bottom in the Note

I found a typo on page 184 of “The Missing Manual: Javascript”. At the very bottom in the Note it states:

“When using the addClass() and removeClass() functions, you only supply the class name - leave out the period you normally use when creating a class selector. For example, addClass(‘externalLink’) is correct, but addClass(‘externalLink’) is wrong”

You will notice that the second example lacks a “period”. The second method should say “but addClass(‘.externalLink’) is wrong”.

Anonymous 
Printed Page 185
2nd paragraph

Last sentence - "...simply adding a class to a tag could complete change that tag's appearance..."

Note from the Author or Editor:
Last sentence of paragraph two should read:
"Because Web browsers process and implement CSS instructions very quickly and efficiently, simply adding a class to a tag can completely change that tag's appearance--even make it disappear from the page."

Anonymous 
Printed Page 185
last line of note

The last sentence of the Note states
"For example, addClass('externalLink') is correct but addClass('externalLink') is wrong."

The last "addClass('externalLink')" should read "addClass('.externalLink')"

Note from the Author or Editor:
Note at bottom of page 185 should read:
When using the addClass() and removeClass() functions, you only supply the class name--leave out the period you normally use when creating a class selector. For example, addClass('externalLink') is correct, but addClass('.externalLink') is wrong.

Anonymous 
Printed Page 242

What the heck is wrong with tutorial 7.1??!

I input it exactly as described in the printed tutorial but when I hovered over each picture, I could see the link to the large copy of the picture in the status bar. My understanding of this tutorial is that when I hovered over the image it would change to the color version based on the line near the bottom of page 242:

"In this function (line 13), you access that value again to set the src back to its original value. Save the page, view it in a Web browser, and mouse over each of the black and white images to see them pop into full color."

If I click on one of the pictures, then it loads a new page giving me the large image on a separate page. I have to back-arrow to return to my page.

I opened up the completed copy of the file. When I ran it I got a fatal error on line 16 saying "console is not defined". Other than that, the page ran exactly the same way.

This first sample is my typed in script. The second sample is the script from the complete_7.1.html.

<script type="text/javascript">
$(document).ready(function()
{
$('#gallery.img').each(function()
{
var imgFile = $(this).attr('src');
var preloadImage = new Image();
var imgExt = /(\.\w{3,4}$)/;
preloadImage.src = imgFile.replace(imgExt, '_h$1');
$(this).hover(
function()
{
$(this).attr('src', preloadImage.src);
},
function()
{
$(this).attr('src', imgFile);
}
);//end hover
}); //end each
}); // end ready
</script>
___________________________
<script type="text/javascript">
$(document).ready(function() {

$('#gallery img').each(function() {
var imgFile = $(this).attr('src');
console.log(imgFile);
var preloadImage = new Image();
var imgExt = /(\.\w{3,4}$)/;
preloadImage.src = imgFile.replace(imgExt,'_h$1');

$(this).hover(
function() {
$(this).attr('src', preloadImage.src);
},
function () {
$(this).attr('src', imgFile);
}
); // end hover
}); // end each
}); // end ready()
</script>
___________________________


Note the line that says: console.log(imgFile);
Not only is this not in the printed book or the Safari Online copy, but its existence gives me an error.

Could you please send me a copy of the correct file?

I specifically chose the JavaScript Missing Manual because other books in the series have been effective and accurate at explaining the processes I am trying to learn. This is the third errata report I have submitted and I have only gotten halfway through the book!

Marjorie Lynch-Freshner

Note from the Author or Editor:
Console.log(imgFile) is in the final tutorial file. That line has been removed from the files online.

The other problem I could not replicated. We need more information such as what browser, what browser version and which platform you are on.

Anonymous 
Printed Page 399
point 8 in the Creating Sortable TablesTutorial

Point 8 in the Creating Sortable Tables Tutorial states:

"8. In your text editor, return to the tables.css files and add one last style:

.sortable tr.even { "


I believe it should have some code and a closing brace. Something like (as listed on page 397):

.sortable tr.even { background-color: #F34; }

This is a lousy color choice, but what they hey.

Note from the Author or Editor:
Step 8 should read:

.sortable tr.even { background-color: #F34; }

Anonymous 
Printed Page 455
The JMaps Tutorial

This tutorial is supposed to allow you to create a Google map on a webpage including allowing the user to get driving directions. I went through the tutorial but despite my best efforts, whenever I input a location and clicked the submit button, directions were not forthcoming.

I attempted to test this function in the "complete" sample provided by the author to see where my mistake might be, but the complete webpage (complete_12.2.html) also displayed the same failure.

The only thing I can think of is that this code needs to be run on a web server (some of the AJAX tutorials can only operate on a web server and not a local computer), but I didn't see explicit instructions or a caveat stating that this was so for the JMaps Tutorial.

Thanks.

Note from the Author or Editor:
There have been several reports that the tutorial for Google maps driving directions does not for some readers of the book. Unfortunately, neither I nor the developer of the jQuery Maps plugin know what is causing this. We're looking into this further and will hopefully have an answer that we can post on the companion web site (www.sawmac.com/javascript/) soon.

Anonymous 

See larger cover

"One of the beauties of the Missing Manuals is that there is always something new to discover and the research is quite thorough...I kept finding snippets of information, in the way of Tips or Notes, that would give just that bit extra."
--Graham K. Rogers, Bangkok Post