Designing with JavaScript, 2nd Edition by Nick Heinle & Bill Pena This errata page lists errors outstanding in the most recent printing. If you have any error reports or technical questions, you can send them to booktech@oreilly.com. (Please specify the printing date of your copy.) This page was last modified on June 22, 2004. Here's the key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem ?page-number?: reader question or request for clarification Confirmed errors: {7} lower sidebar -- change to read: A variable name must start with a letter, an underscore character, or a dollar sign. Subsequent characters can be letters, underscores, dollar signs, or digits. Thus, these are valid variable names: myCan, Can1, $Can, and _Can1. These are not: 1Can and !Can. (47) Footnote: The footnote mentions a Dynamic HTML technique covered in Chatper 9, but it isn't included in Chapter 9. Here it is - Here's the solution. Replacing each instance of 'window.document.width' in the script with 'document.body.clientWidth' (note capitalization) will work in both Netscape 6+ and IE5+. The exception ie IE6 when in "strict" or "standards compatability" mode, which is turned on by using a doctype tag like the following: In this case, rather than returning the width of the client window minus the scrollbars, document.body.clientWidth returns the width of the element, which, in my tests, amounts to the width of the client window including the scrollbars. In this instance, use document.documentElement.clientWidth to get the same value as for all the other browsers. [126] Example 8-11 Insert the following line: var reg = document.forms["reg"]; as the first line after the comment in setValues(), so you have: // Set cookie values from form data var reg = document.forms["reg"]; setCookie(reg.yourname.name, reg.yourname.value, exp); Also, insert the following line: var reg = document.forms["reg"]; as the first line after the first comment in getValues(), so you have: // Get cookie values var reg = document.forms["reg"]; var namevalue = getCookie(reg.yourname.name); [127] Example 8-12 The sames changes as for Example 8-11. {175 & 176} Under "Making a Question object" the Question() constructor code and Ex. 11-11; In the Question() constructor, the second argument should be 1 not 2 on both pages. {189} Example 11-22 Change the line: setTimeout("showLayer()", 20); to read: setTimeout("xbStyleShowLayer()", 20); {189} Example 11-23 Change the line: var left = styleObj.getLeft(); to read: var left = styleObject.getLeft(); {190} Example 11-23 Change the line: setTimeout("showLayer()", 20); to read: setTimeout("xbStyleShowLayer()", 20)