DOM Scripting comments: Tell me my typos http://domscripting.com/blog/display/29 The book is going to be reprinted and I need to know what needs fixing. en Jeremy Keith http://domscripting.com/blog/display.php/29#comment122 Guy, we should definitely get together for a beer sometime.

Thanks for pointing out that typo for page 107. Unfortunately it’s too late now to get it into the reprint but I’ll add to my list.

As for the whole toggling of the "odd" variable, yes, I did do it for pedagogical, rather than coding reasons.

You’re right: the changes you suggest would be more elegant, but then I would also have to explain exactly what was going on. By simply writing code that’s close to the English, "if odd is equal to true…", the flow of the logic is fairly clear without any extra explanation.

There’s quite a few places in the book where the code could be shortened and improved considerably, but I generally chose readability and clarity at the expense of code elegance.

Also, I’m sure many programmers would balk at my constant flaunting of structured programming best practices. Again, it was readability I was striving for.

Now, about that beer…

]]>
Wed, 09 Nov 2005 20:24:15 GMT
Guy McCusker http://domscripting.com/blog/display.php/29#comment114 I guess I am too late with these but I only found the book in Brighton Waterstone’s this weekend.

p107 there’s a line

if (whichpic.getAttribue("title"))

which should clearly say "getAttribute".

p196, nothing incorrect but you’ve done something that makes me shout at my year 1 programming undergrads:

if (odd == true)

should just be

if (odd)

This may be a pedagogical decision on your part I suppose but I strongly object to using == to check boolean data.

Also I’d prefer the two lines

odd = false; and odd = true;

to come outside the if-statement and coexist as

odd = !odd;

which makes it clear that you’re toggling.

Very nice book, clear explanations etc. I want to buy you a beer in Brighton sometime.

Guy.

]]>
Tue, 08 Nov 2005 14:19:39 GMT
Kevin http://domscripting.com/blog/display.php/29#comment112 Probably too late to add (and also pretty minor)….but I just got your book the other day. I noticed that at the end of chpt 4 you provide a picture of how the image gallery looks after the mark up is applied. I believe that by using the float: left; in the li tag, the placeholder image will float left as well, unless the float is cleared (atleast this is how it acted in my browser..safari for mac). I just created a .seperate { clear: both;} and applied the class prior to the placeholder. This way the placeholder clears the float and will align under the links, not next to them.

Enjoying the book very much.

]]>
Sun, 06 Nov 2005 04:03:54 GMT
Shane Bonham http://domscripting.com/blog/display.php/29#comment103 Pretty minor, but page 25 (of my edition) lists the arithmetic operators and refers to the operator for division as a backslash. I believe that should be a forward-slash (or simply, slash).

]]>
Mon, 31 Oct 2005 21:37:12 GMT
Dustin http://domscripting.com/blog/display.php/29#comment99 Doh. I’ll need to finish quickly then. I have some other typos as well…just hold…one…more…second…

]]>
Thu, 27 Oct 2005 06:00:33 GMT