 |
BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0
 | This is the forum to discuss the Wrox book Professional JavaScript for Web Developers by Nicholas C. Zakas; ISBN: 9780764579080 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

June 20th, 2005, 09:58 AM
|
 |
Wrox Author
|
|
Join Date: Dec 2004
Posts: 217
Thanks: 0
Thanked 5 Times in 5 Posts
|
|
Right again, Alexei, I'll submit it to Wrox.
Thanks!
Nicholas C. Zakas
Author, Professional JavaScript for Web Developers (ISBN 0764579088)
http://www.nczonline.net/
|
|

June 20th, 2005, 02:13 PM
|
|
Wrox Technical Editor
|
|
Join Date: May 2005
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Page 320, next to last paragraph
Quote:
quote:As you can see, oRange1âs startContainer, endContainer, and commonAncestorContainer are equal
to the <body/> element because the <p/> element is wholly contained within it. Also, startOffset is
equal to 0, because the <p/> element is the first child of <p/>, and endOffset is equal to 1, meaning that
the range is over before the second child node (which is index 1).
|
<p/> element is the first child of <body/>?
Best regards,
Alexei
|
|

June 23rd, 2005, 10:48 AM
|
|
Wrox Technical Editor
|
|
Join Date: May 2005
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Page 171, next to last code block
Code:
var oPs = document.getElementsByTagname(âpâ);
var oImgsInP = oPs[0].getElementsByTagName(âimgâ);
Typo (getElementsByTagName)
Best regards,
Alexei
|
|

June 24th, 2005, 04:14 AM
|
|
Wrox Technical Editor
|
|
Join Date: May 2005
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Page 327, last code block
Actually I had some hesitations concerning this topic but still...
Code:
var oP1 = document.getElementById(âp1â);
var oP2 = document.getElementById(âp2â);
var oRange = document.createRange();
oRange.setStartAfter(oP1);
oRange.setStartBefore(oP2);
alert(oRange.collapsed); //outputs âtrueâ
Quote:
quote:In this case, the created range is collapsed because there is nothing between the end of p1 and the beginning
of p2.
|
I would say that in this case the created range is collapsed because we didn't set the end of the range. May be selected line should be
oRange.setEndBefore(oP2); or may be I missed the point.
And another reason: according to my experiments :) if you try original code and there are indeed other nodes between p1 and p2 you'll get
Quote:
|
quote:Error: uncaught exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIDOMRange.setStartBefore]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: http://localhost/ranges.html :: compareRange :: line 16" data: no]
|
Best regards,
Alexei
|
|

June 27th, 2005, 09:57 AM
|
 |
Wrox Author
|
|
Join Date: Dec 2004
Posts: 217
Thanks: 0
Thanked 5 Times in 5 Posts
|
|
Alexei, you're right on both counts. I suspect the incorrect capitalization was due to Word's "autocorrect" features. The range issue is undoubtedly a copy-paste oversight.
Thanks,
Nicholas
Nicholas C. Zakas
Author, Professional JavaScript for Web Developers (ISBN 0764579088)
http://www.nczonline.net/
|
|

June 27th, 2005, 10:49 AM
|
|
Registered User
|
|
Join Date: Jun 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi!
Some possible errors or missprint.
Page 45.
In first example we have a variable bTrue, but in paragraph following the example, last sentence we find "so that a is set to false", maybe bTrue? (maybe the sentence will be changed...).
Page 46.
" ...the variable c is undefined." bUnknown?
Page 52
Conditional operator last sentence "...iNum2 is less than..." Maybe great than?
Page 67
Last paragraph "As discussed briefly in Chapter 1, ..." Maybe Chapter 2?
Page 69
First paragraph. "In Chapter 1..." Chapter 2?
Page 78
In using UTC(), in paragraphs we find 2004, but in examples 2003?
I've lost something how use UTC()?
Page 84
Second table LOG10E Description "The base 1 logarithm of E". Isn't base 10?
I have a question on using return in function, but I'll send as new topic. It's a stupid question but I'd like understand more...
Bye.
Paolo
|
|

June 27th, 2005, 11:27 AM
|
 |
Wrox Author
|
|
Join Date: Dec 2004
Posts: 217
Thanks: 0
Thanked 5 Times in 5 Posts
|
|
Paolo,
You are right on all counts, these are all mistakes and need to be fixed. Thanks so much for point this out to me. If you find any other mistakes, don't hesitate to post them.
Thanks,
Nicholas
Nicholas C. Zakas
Author, Professional JavaScript for Web Developers (ISBN 0764579088)
http://www.nczonline.net/
|
|

July 8th, 2005, 02:21 AM
|
|
Wrox Technical Editor
|
|
Join Date: May 2005
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
May be it doesn't fit this topic but I am more comfortable to post it here :).
Chapter 11, page 346.
(CodeExamples formutil. js -> FormUtil.tabForward)
Code:
for (var i=0; i < oForm.elements.length; i++) {
if (oForm.elements[i] == oTextbox) {
for(var j=i+1; j < oForm.elements.length; j++) {
if (oForm.elements[j].type != "hidden") {
oForm.elements[j].focus();
I've tried to use this function in current project and stumbled upon following issue:
While "tabforwarding" through controls I got an error "Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus." The reason was that next control was disabled (I think itâs quite common case). Firefox unlike IE doesnât raise an error but stops on this control anyway. So may be it would be appropriate to add this condition:
Code:
if (oForm.elements[j].type != "hidden" && !oForm.elements[j].disabled)
After further experiments I've found another peculiarity: I think there must be preconditions concerning some keys (at least "Shift"). It is quite difficult to select text of "full" textbox because focus always tries to escape to next control :).
And, yes, I am aware that examples in the book were not intended to be of production quality. So notes above are just thoughts about some improvements of this particular method and again I probably should post it in different topic. But what's done can't be undone  .
Best regards,
Alexei
|
|

July 9th, 2005, 07:50 PM
|
 |
Wrox Author
|
|
Join Date: Dec 2004
Posts: 217
Thanks: 0
Thanked 5 Times in 5 Posts
|
|
Very interesting find. I had never tried it with disabled controls, that's a good catch! Your code update is probably the best approach.
Nicholas C. Zakas
Author, Professional JavaScript for Web Developers (ISBN 0764579088)
http://www.nczonline.net/
|
|

September 13th, 2005, 01:12 AM
|
|
Wrox Technical Editor
|
|
Join Date: May 2005
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Page 273
Misprint: duplicate property name pageX instead of pageY.
Best regards,
Alexei
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| mistake in code |
yami56 |
Access |
3 |
February 24th, 2005 04:04 PM |
| mistake in my topics |
zakarya_hazara |
Classic ASP Basics |
1 |
October 9th, 2004 02:49 AM |
| Dangerous mistake |
revinchalil |
SQL Server 2000 |
4 |
February 4th, 2004 12:06 PM |
|
 |