WebWoman's Books

JavaScript Concepts & Techniques:
Programming Interactive Web Sites

Errata (Corrections)
Last Update: 20 March 2005

3rd Printing | 2nd Printing | 1st Printing | Which printing do you have?

3rd Printing

Page

Description

Submitted by

442 Line 45 of Script 13.4 should be corrected to read:
if (isEmpty(pwd.value) || isEmpty(pwdConfirm.value)) {
Bart Humphries,
André
CD Script 13.4 (script13-04.html), Line 46:
  if (isEmpty(pwd.value) || isEmpty(pwd.value)) {
should read:
  if (isEmpty(pwd.value) || isEmpty(pwdConfirm.value)) {
Bart Humphries

 

2nd Printing

Page

Description

Submitted by

92 The parseFloat example at the top of the page, should read:
var num1 = parseFloat(prompt("Enter a number:", ""))
Three quotes are incorrectly listed as the second paramater; there should only be two.
Michael Carter
94 Line 9 of Script 3.8, should read:
document.write("Guess: ", guess, "<br>")
Script 3.8 on the CD is already correct.
Michael Carter
98 Script 3.10, line 29, should read:
 document.write("document.bgColor: ",
   typeof(document.bgColor), "<br>")

The opening quote before the <br> tag was missing in the book. The script on the CD is ok as is.
Felicity,
Michael Archipley
102 Exercise 3k, should read:
typeof(parseInt("seven"))
The second closing paren was missing in the book.
Felicity
184 Exercise 4, should read:
var num
do {
      num = parseFloat(prompt("Enter a number:", " "))
} while (isNaN(num))
Gaine Chung
209 Table 7.1 in the Method column: the unshift entry should be corrected as follows.
unshift(element1[, element2, ...])
Tina McDuffie
245 Exercise 1: the proposed function should calculate the area of a right triangle. The formula works for any triangle. Bart Humphries
252 Table 9.2 in the Example column: the fontsize example should be corrected as follows.
zStr.fontsize(4)
Kristine C.
257 The code and text after "One more example: " should read:
"my string".substring(1, ("my string".length-2))
returns
   y stri
Kristine C.,
Bob Blum
296 Table 10.1, entry for toGMTString(), Description column should read:
...toGMTString is deprecated, replaced by toUTCString.
Bart Humphries
302-306 Scripts 10.3, 10.4, and 10.5 report the minutes without a leading zero, ie. 8:07 p.m. would be reported as "8:7 p.m.". All three scripts can be corrected as follows by replacing
  today.getMinutes()
with
(today.getMinutes() < 10) ? "0" + today.getMinutes() : today.getMinutes()
in Line 29 of Script 10.3, Line 28 of Script 10.4, and Line 43 of Script 10.5. The line numbers will be slightly different in the scripts on the CD.
Cindy
345 In Table 11.4, in the Option/Values column:
locationbar[=yes | no] | [=1 | 0]
statusbar[=yes | no] | [=1 | 0]
Tina McDuffie
361 "You can change the document loaded in a particular frame either by calling the replace method of the location object or by modifying the location href property of the document location object. " Tina McDuffie
397 The last line of the last paragraph should read:
Lines 145, 157, 169, 181, and 193 of Script 12.3 demonstrate this technique:
Bart Humphries
402

Not really a correction, so much as a suggested work around.
Some older browsers such as Opera 5.02 do not support the blur method. One way you can work around this and still prevent the extended price field from being modified is to give focus to, and select, the quantity field on that line. This solution also lets the visitor know in a friendly way that the extended price may only be changed by changing the quantity ordered.

Thomas Powell
442 Line 45 of Script 13.4 should be corrected to read:
if (isEmpty(pwd.value) || isEmpty(pwdConfim.value)) {
Bart Humphries
CD Script 13.4 (script13-04.html), Line 46:
  if (isEmpty(pwd.value) || isEmpty(pwd.value)) {
should read:
  if (isEmpty(pwd.value) || isEmpty(pwdConfirm.value)) {
Bart Humphries

 

1st Printing

Page

Description

Submitted by

25 Line 19 of Script 1.5, should appear on line 20. On line 20, the following should be listed:
document.write("current: ", window.history.current, "<br>")
Andrea Baughman
26 "The history property, length, indicates the total number of items in the history list (line 19 20)."

Figure 1.10 should show
current:
directly under "Some history Properties."
Andrea Baughman
47 "A good HTML validator can help you locate and eliminate HTML editors errors quickly and painlessly..." Andrea Baughman
92 parseFloat example at the top of the page, should read:
var num1 = parseFloat(prompt("Enter a number:", ""))
Three quotes are incorrectly listed as the second paramater; there should only be two.
Michael Carter
94 Line 9 of Script 3.8, should read:
document.write("Guess: ", guess, "<br>")
Script 3.8 on the CD is already correct.
Michael Carter
96 "operand is the variable, object, object property, string literal, or special keyword..." Tina McDuffie
98 Script 3.10, line 29, should read:
 document.write("document.bgColor: ",
   typeof(document.bgColor), "<br>")

The opening quote before the <br> tag was missing in the book. The script on the CD is ok as is.
Felicity
102 Exercise 3k, should read:
typeof(parseInt("seven"))
The second closing paren was missing in the book.
Felicity
115 Not really an error, just a suggestion.

Table 4.3: in the Name column, the = operator is called "equals". To avoid confusion with the == (is equal to) operator, you can also call the = (equals) operator, "gets" or "gets the value of", to make the distinction between the assignment operator (=) and the comparison operator (==) clearer.
Gerald Pullen
124 Table 4.6: In the Operator column of Order of Operations 9, the inequality operator is listed as !===, but should be !==. Kristine C.
 177 "In the following example, the plan is to ask the visitor for his 10 seven favorite movies." Chris
184 Exercise 4, should read:
var num
do {
      num = parseFloat(prompt("Enter a number:", " "))
} while (isNaN(num))
Gaine Chung
208 - 209 Table 7.1 in the Method column: the concat, join, and unshift entries should be corrected as follows.
concat(array2[, array3, ...])
join([separator])
unshift(element1[, element2, ...])

Tina McDuffie
209 split("delimiter"[, maxElements])
should be
split("delimiter"[, maxElements])
Tina McDuffie
245 Exercise 1: the proposed function should calculate the area of a right triangle. Gerald Pullen
252 Table 9.2 in the Example column: the fontsize example should be corrected as follows.
zStr.fontsize(4)
Kristine C.
257 The code and text after "One more example: " should read:
"my string".substring(1, ("my string".length-2))
returns
   y stri
Kristine C.
296 Table 10.1, entry for toGMTString(), Description column should read:
...toGMTString is deprecated, replaced by toUTCString.
Bart Humphries
302-306 Scripts 10.3, 10.4, and 10.5 report the minutes without a leading zero, ie. 8:07 p.m. would be reported as "8:7 p.m.". All three scripts can be corrected as follows by replacing
  today.getMinutes()
with
(today.getMinutes() < 10) ? "0" + today.getMinutes() : today.getMinutes()
in Line 29 of Script 10.3, Line 28 of Script 10.4, and Line 43 of Script 10.5. The line numbers will be slightly different in the scripts on the CD.
Cindy
331 Script 11.2, Line 4:
<base target="SurfWin">
should be
<base target="_blank">
Script 11.2 on the CD is already correct.
Gerald Pullen,
Mary S.
345 In Table 11.4, in the Option/Values column:
locationbar[=yes | no] | [=1 | 0]
statusbar[=yes | no] | [=1 | 0]
Tina McDuffie
361 "You can change the document loaded in a particular frame either by calling the replace method of the location object or by modifying the location href property of the document location object. " Tina McDuffie
397 The last line of the last paragraph should read:
Lines 145, 157, 169, 181, and 193 of Script 12.3 demonstrate this technique:
Bart Humphries
442 Line 45 of Script 13.4 should be corrected to read:
if (isEmpty(pwd.value) || isEmpty(pwdConfim.value)) {
Bart Humphries
600 The object named "History" should be "history"; it should not be capitalized. Tina McDuffie
CD Script 5.5 (script05-05.html) line12 and Script 5.6 (script05-06.html) line 9:
    method="pose"
should be
    method="post"
MTM
CD Script 13.4 (script13-04.html), Line 46:
  if (isEmpty(pwd.value) || isEmpty(pwd.value)) {
should read:
  if (isEmpty(pwd.value) || isEmpty(pwdConfirm.value)) {
Bart Humphries

 

 



JavaScript Concepts: About the Book | Errata/Corrections | FAQ | Glossary | Index | Instructor Resources | Reviews | Sample Chapter | Table of Contents
JavaScript Object Reference: About the Book | Reviews | Table of Contents
About WebWoman: About the Author | Contact Info | Credentials | Privacy Policy | Security Policy | Site Credits