- ISBN13: 978-1-59059-764-4
- ISBN10: 1-59059-764-8
- 221 pp.
- Published Sep 2007
- Print Book Price: $39.99
- eBook Price: $27.99
Errata Submission
If you think that you've found an error in Accelerated DOM Scripting with Ajax, APIs, and Libraries, please let us know about it. You will find any confirmed erratum below, so you can check if your concern has already been addressed.
Errata
| Issue | Author's Response |
|---|---|
| chapter 5, page 113, 1-st paragraph Typo: "CDATA sections begin with the string "<![CDATA]" Should be "<![CDATA[", the second square bracket should be an open bracket |
Indeed, the CDATA string should start with "<![CDATA[". |
| With respect and thanks to authors of this book; In chapter 2,page 50 of the book, in changeLinksToNewWindow function : I think (I'm not sure) if the currentDomain is in the href so we have "internal" <a> links not "external"! and i guess the if condition (if(elements[i].href.lastIndexOf(currentDomain) >= 0)) should be vice versa. please let me know if i'm wrong. and that would be a favour of u if u give me some clear explanation about the regular expression is used in this sample ("/^http:\/\/[^\/]+/" i dont understand [^\/] in it). |
The comment in the book above the IF statement is correct that the condition will be met if the currentDomain is in the href. Which, as you've correctly pointed out, is the opposite of what we wanted. Instead of >= 0, we should check for == -1 (the -1 means it isn't found). As to the regular expression, the ^ character has two meanings depending on its context. The first one means, "find the beginning of the string". In this case, only find http:[etc] if it's at the beginning of the href. The \ is an escape character. So \/ means, find the forward slash / and don't confuse it with the end of the regular expression. Next, the square brackets [ ] allow us to search for a range of characters. By placing a ^ as the first character in the brackets, we're saying, DON'T match any of the characters in the brackets. So, [^\/] means match a character as long as it's not a forward slash /. The plus after it says to match one or more times. An href of "http://example.com/morepath/" will sta |
| Ch. 3 - pg 59 - ["...example of a class and a constructor in Java(the important parts are bold): "] then after that the java code is as follows. public class Hello { public static void main(String[] args) { System.out.println("Hello, World!"); } } This is not an example of a Java class with a constructor. The main is just the initial entry point if you were to run this code as a java application. The correct implementation of this would be. public class Hello { public Hello() { System.out.println("Hello, World!"); } } Underneath the example Java code it states "The main function gets called every time you create a new object from this class." In fact the main function does not get called whenever you instantiate a new object of the Hello class. The constructor would get called. |
Thank you for the clarification. Indeed, you are correct with the following example of a Java constructor. public class Hello { public Hello() { System.out.println("Hello, World!"); } } |
