Topic: Web

Professional JavaScript for Web Developers (0764579088) cover image

Professional JavaScript for Web Developers

Nicholas C. Zakas
ISBN: 978-0-7645-7908-0
Paperback
672 pages
April 2005
This title is out-of-print and not currently available for purchase from this site.

Do you think you've discovered an error in this book? Please check the list of errata below to see if we've already addressed the error. If not, please submit the error via our Errata Form. We will attempt to verify your error; if you're right, we will post a correction below.

ChapterPageDetailsDatePrint Run
7 Wrong Prefix for Arrays in Chapter 7
In chapter 7, the code uses \"arr\" as a prefix for arrays, instead of the stated \"a\" - as mentioned on page 14.
5/16/05
vii Error in Text, 2nd Paragraph
Page vii (Acknowledgements), 2nd paragraph:

"First are foremost" should read "First and foremost".
5/30/05
12 2nd bulleted paragraph, first line in bold:
"Comments are the same as in Java, C, and Perl"

should be:

"Comments are the same as in Java, C, and PHP"
5/4/05
23 Error in Text
2nd paragraph after the Converting to a number heading, line 7, near the end of the line:

Text reads:
one

Should read:
once
07/19/2006
24 Error in Text
Bullet list, 3rd item

"casts the given value a string"
should be
"casts the given value as a string"
11/28/05
26 Error in Text
1st bullet list, 2nd item, 2nd line

"For the all classes"
should be :
"For all classes"
11/28/05
27 Error in code
First line of code:

"oBooleanaobject"
should be:
"oBooleanObject"
11/28/05
33 First Line
\"Is variable s an instance of the class String?\"

Should be:

\"Is variable oStringObject an instance of class String?\"
5/16/05
41 Error in text
Last paragraph, 2nd sentence reads:
"The left shift fills these bits with the value in the 32nd bit (the sign bit)...

It should say:
"The left shift fills these bits with 0's..."
4/19/06
42 Replace binary string
At the end of the first paragraph, the long binary string should be:
11111111111111111111111111111110
4/19/06
42 Replace paragraph
replace last paragraph with:
"For numbers that are negative, though, something quite different
happens. You see, the unsigned right shift operator fills all empty
bits with zeroes. For positive numbers, this behaves exactly the same
as the signed right shift. Negative numbers, however, are treated as
if they are positive. Since the result of unsigned right shift is a
positive 32-bit number, you end up with a very large number whenever
operating on a negative number. For example, if you shift 64 to the
right by five bits, you end up with 134217726. How does this happen?"
4/19/06
43 Error in text
First paragraph, second sentence should say:
"To do so, you need to convert this number to its unsigned equivalent
(though the number itself is still signed behind the scenes), which
can be attained..."
4/19/06
43 Error in code
First code snippet should be: var iUnsignedNeg64 = -64 >>> 0;
4/19/06
43 Error in code
Second code snippet should be:
alert(iUnsignedNeg64.toString(2));
4/19/06
44 Error in variable names
In first paragraph, all variable names (3 instances)

"found"
should be:
"bFound".

This includes changing !found to !bFound.
11/28/05
45 Missing Word in Sentence
2nd paragraph, last sentence:

"If this example is changed so that a is set to false, the error won't occur:"
should read:
"If this example is changed so that the first operand is set to false, the error won't occur:"
7/6/05
46 Error in text
3rd paragraph, first sentence:
"As with the previous example, the variable c is undefined."

should read:
"As with the previous example, the variable bUnknown is undefined."
7/6/05
52 Re-wording of Sentence
Paragraph before "Assignment Operators" heading, last sentence:

"If, however, the expression is false (meaning that iNum2 is less than or equal to iNum1), iNum2 is assigned to iMax."

should read:

"If, however, the expression is false (meaning that iNum2 is greater than or equal to iNum1), iNum2 is assigned to iMax."
7/6/05
67 First Sentence Should Begin...
Last paragraph, first sentence should begin:

"As I discussed briefly in Chapter 2,"
7/6/05
69 First Sentence Should Begin...
First paragraph, first sentence should begin:

"In Chapter 2,".
7/6/05
71 Error in Code Block
Code block just before the gray shaded box, last line:

alert(arr.length); //outputs "26"
Should say:
alert(aColors.length); //outputs "26"
6/21/05
73 Error in Code Block
First code block 2nd line (highlighted):

var aColors2 = arr.concat("yellow", "purple");
should be:
var aColors2 = aColors.concat("yellow", "purple");
6/21/05
73 Error in Code
2nd code block 2nd line (highlighted) and 3rd line:

var aColors2 = arr.slice(1);
var aColors3 = arr.slice(1, 4);
should be:

var aColors2 = aColors.slice(1);
var aColors3 = aColors.slice(1, 4);
6/21/05
77 Error in Text
2nd text paragraph, last line.

"I discussed this further in Chapter 12"
should be:
"This is discussed further in Chapter 12"
11/28/05
78 Error in Code
Last three code examples should use 2004 instead of 2003 in the code.
7/6/05
79 Text Error
Top of page, first sentence:

Internet Explorer displays February 2, 2003 as "Sat Feb 2 00:00:00 EST 2003" while Mozilla displays it as "Tue Feb 2 2003 00:00:00 GMT-0400 (Eastern Daylight Time)".

Should say:

Internet Explorer displays February 2, 2003 as "Sun Feb 2 00:00:00 EST 2003" while Mozilla displays it as "Sun Feb 02 2003 00:00:00 GMT-0400 (Eastern Daylight Time)".
6/20/05
84 Re-wording of Description of LOG10E
Second table, 5th line, description of LOG10E:
"The base 1 logarithm of E."
should be:
"The base 10 logarithm of E."
7/6/05
3 86 Error in Table
table at the bottom of page:
the function atan2(y, x) has the definition of "Returns the arc cosine of y/x"
arc cosine
should be
arc tangent
10/25/07
89 Error in Text
3rd paragraph:
this is equal to car

should read:
this is equal to oCar
7/23/06
91 Error in Code
2nd code block, 3rd line from end:
var oCar1 = createCar("blue", 3, 25);

should be:
var oCar2 = createCar("blue", 3, 25);
4/17/06
95 Error in text
1st paragraph 4th line

"so when it output"
should be:
"so when it outputs"
11/28/05
130 Error in Text, 2nd Paragraph
Second paragraph, 4th line:

"inside of inline code"

should be :

"instead of inline code"
5/30/05
143 Code Error
First paragraph:

"input()"
should be:
"prompt()".
8/24/05
162 Error in Text
first paragraph, end:
instead of ending with (???)

the first paragraph should end:
notation appear first.
5/25/06
171 Error in Code Block
Second to last code block first line:

var oPs = document.getElementsByTagname("p");
should be:
var oPs = document.getElementsByTagName("p");
7/6/05
193 Error in Text
first paragraph, end of line 3:
gred

should be:
grep
3/24/06
194 Error in Text
Next to last paragraph first sentence:

"The RegExp exec() method, which takes a string as an argument, returns an Array containing all matches."

should read:

"The RegExp exec() method, which takes a string as an argument, returns an Array. The first item in the array is the first match ; the others are backreferences (which will be discussed shortly)."
6/15/05
194 Error in Text
Last paragraph. Insert the following after the first sentence:

"But of what use is returning an array with only one item? Suppose you want to get all of the occurrences of a pattern. This is where a different method can be used."
6/15/05
194 Deletions in Last Paragraph
Last paragraph:

Delete 2nd sentence, delete 3 lines of code at end of page.
6/15/05
194-195 Corrected Pages
A corrected version of pages 194-195 fixing the errata noted on 6/15/2005 is available in PDF format.

You can download it here: http://www.wrox.com/WileyCDA/WroxTitle/productCd-0764579088,descCd-download_code.html
12/29/05
195 Deletions on Page
Delete the first paragraph, first code block, and paragraph following first code block
6/15/05
195 Error in Text
Replace the paragraph after the table with:

"The String object has a method called match(), which returns an array of all matches within the string. The method is called on the String object and the RegExp object is passed in as an argument:"
6/15/05
195 Replacing Text
Paragraph (single sentence) after the 2nd code block, replace with:

"This code fills the aMatches with all of the instances of "at" in the order in which they appear in sToMatch. Here are the contents of the aMatches array after this code executes:"
6/15/05
195 Move Table
Move the table to follow the new paragraph:

"This code fills the aMatches with all of the instances of "at" in the order in which they appear in sToMatch. Here are the contents of the aMatches array after this code executes:"
6/15/05
195 Error in Text
Paragraph before the final code block, first sentence:

"A String method calls search() that acts the same way"
should be :
"Another String method called search()acts the same way"
6/15/05
204 Error in Code Block
Large code block:
9th line:

re2.test("aabb"); //true - match!
should be:
re2.test("aabb"); //false - no match
6/15/05
204 Error in Code Block
Large code block:
15th line:

re2.test("aaab"); //true - match !
should be:
re2.test("aaab"); //false - no match
6/15/05
205 Text Error
First paragraph, last sentence:

"This section introduces these concepts and more, so you can use regular expressions to make complex string manipulations easier."

Delete the word "you" before "regular expressions".
6/15/05
206 Text Error/Code Error
First line of code:

var reExtraSpace = /^\s+(.*?)\s*$/;
should be:
var reExtraSpace = /^\s*(.*?)\s*$/;


paragraph following that: change the first sentence to:
This regular expression looks for zero or more occurrences of white space at the beginning of the string, followed by any number of additional characters (which are captured in a group), followed by zero or more occurrences of white space at the end of the string.
1/05/06
222 Error in Code
First code block:

var reEmail = /^(?:\w+\.?)*\w+@^(?:\w+\.?)*\w+$/;

should be:

var reEmail = /^(?:\w+\.?)*\w+@(?:\w+\.)+\w+$/;
6/16/05
222 Error in Code
2nd code block, 2nd line:

var reEmail = /^(?:\w+\.?)*\w+@^(?:\w+\.?)*\w+$/;

should be:

var reEmail = /^(?:\w+\.?)*\w+@(?:\w+\.)+\w+$/;
6/16/*05
222 Replace Sentence
6th text paragraph, replace 2nd sentence with:

Immediately after that is the non-capturing group (?:\w+\.), which can appear one or more times, so the plus sign is used.
6/16/05
6 236 Replace Code
Replace the shaded section of code completely with this:

for (var i=0; i < aVersion1.length; i++) {
var iVal1 = parseInt(aVersion1[i], 10);
var iVal2 = parseInt(aVersion2[i], 10);

if (iVal1 < iVal2) {
return -1;
} else if (iVal1 > iVal2) {
return 1;
}
}

return 0;
5/30/06
6 236 Add Line in Text
In the paragraph immediately following the code, insert this sentence immediately after the first sentence:

The values in each array are first converted to integers for comparison.
05/30/2006
269 Error in Code
oDiv.addEventListener(\"onclick\", fnClick1);
oDiv.addEventListener(\"onclick\", fnClick2);

Should be:
oDiv.addEventListener(\"click\", fnClick1, false);
oDiv.addEventListener(\"click\", fnClick2, false);
5/16/05
273 Error in Table
In table, first column, 13th row:
pageX

should be:
pageY
5/25/06
274 Text Error
Last paragraph: the first sentence:

"always contains a code the represents"
should be :
"always contains a code that represents"
6/20/05
287 Text Error
Last paragraph: Last sentence should read :

"So, if you set the onload event handler on the <body/> element and then check the window.onload property (as in the following example), you will see that the event handler code has been placed there."
6/20/05
287 Add New Line to Code Block
Last code block:

After the line with the </script> tag (the 8th line), add a new line:
</head>

This new line should be indented the same as the <head> line, the 2nd line of code.
6/20/05
299 Error in Code
Page 299, code block at top, the shaded line:

Code reads:
oEvent.time = (new Date).getTime();

Should read:
oEvent.timeStamp = (new Date()).getTime();
07/14/2006
312 Text Error
Last paragraph, first sentence:

"Microsoft offers a currentStyle object on each element that includes all properties from the element background-color object as well the properties from any relevant CSS rule's style object."

Should read:

"Microsoft offers a currentStyle object on each element that includes all properties from the element's style object as well the properties from any relevant CSS rule's style object."
6/20/05
320 Error in Code
Second-to-last paragraph, 2nd sentence:

Also, startOffset is equal to 0, because the <p/> element is the first child of <p/>

should read:

Also, startOffset is equal to 0, because the <p/> element is the first child of <body/>
6/21/05
327 Error in Code Block
Last code block 5th line:

oRange.setStartBefore(oP2);
should be:
oRange.setEndBefore(oP2);
7/6/05
239 Error in Text
under heading "Detecting Konqueror/Safari", third text paragraph, first line:
The first four strings are from Konqueror; the last two are from Safari.

should be:
The first four strings are from Konqueror; the last three are from Safari.
8/17/06
351 Error in Code
Near bottom of page, first code line in the first code section under the "Blocking paste" heading and again in the first code line in the second code section:

Beginning of line

<input type="text" onkeypress="return allow
should be
<input type="text" onkeypress="return TextUtil.allowChars
12/22/05
462 Error in Code
Starting with the 4th code line not counting blanks

oXmlDom.addEventListener("load", function () {
this.__initError__();
this.__changeReadyState__(4);
}, false);

should be:

oXmlDom.addEventListener("load", function () {
this.__checkForErrors__();
this.__changeReadyState__(4);
}, false);
3/16/06
470 Error in Code
Second-to-last code example, 2nd line:

Please also note to maintain the indented wrapping of this line of code which wraps to 2 lines.

var oResult = oEvaluator.evaluate("count(employee/name)", oXmlDom.documentElement,null, XPathResult.BOOLEAN_TYPE, null);

should be:

var oResult = oEvaluator.evaluate("count(employee/name)", oXmlDom.documentElement,null, XPathResult.NUMBER_TYPE, null);
3/16/06
518 Error in Text
Next to last text paragraph, 1st line:

"Next you create the SOAPCall"
should be:
"Next you call the SOAPCall"
5/30/05
518 Error in Code Block
Jast code block on page. first line:

"oSOAPCall.encode"

should be:

"oSoapCall.encode"
5/30/05
585 Error in 3rd Code Block
3rd code block. last line (only shaded line in the 3rd code block), this is the last code line before the "unroll your loops" heading:

} while (i-- >= 0);
should be:
} while (--i >= 0);
12/27/05