Designing with JavaScript: Creating Dynamic Web Pages.  Nick Heinle & Bill Peña.  Second Edition. 

Cambridge, MA: O'Reilly; 2002; 216 pps. $34.95 (ISBN: 1-56592-360-X)

 

During high school in the 60s I took a typing course.  Our typewriter manual instructed on the mechanics of producing different effects in typed pages (i.e., setting tabs, line spacing, right and left margins, etc.).   That typewriter manual was a technological guide for producing various written effects in the paper era.  Heinle and Peña present us with a guide for producing visual effects in the Web era.   This book is a technological guide for Web authors who want to take advantage of  JavaScript.

 

JavaScript is a standard scripting language that permits the creation of dynamic, interactive HTML, interrogation of the Document Object Model and, combined with Cascading Style Sheets, the creation of visually complex Web pages.  The significance of JavaScript, however, is that it is a fundamental authoring resource.  Example strategies covered in the book include a remote console that throws content to a background window, scrolling images, rotating images, drop-down menus and sideways sliding menus.  Prior to this book, many of these techniques were available only in fragmented and often excessively tricky presentations on the Web.   With this book in hand and following the clear, simple and useful examples, every Web author can enhanced the expressiveness of  Web pages.

 

The authors treat JavaScript syntax fundamentals thematically by presenting requirements as they appear in the chapter examples.  Reader interest is maintained by the development of one or more chapter examples.  Sidebars and emphasis boxes alert the reader to syntactical traps. There is a note on debugging wherein we learn that "The topics in the book straddle the line between designing and programming."  (p. 31).  Helpfully, chapters conclude with a complete code example.  A primary virtue of these code cliches  is that useful and compelling applications are presented in code that hardly occupies one page.   The examples are clear, transparent and easily assimilated.   

 

The most important traditional JavaScript topics are presented.  These include browser sniffing, form-entry validation and array manipulation.  An introduction to regular expressions is glossed in one page.  There is a chapter about using cookies.

 

Newer and more sophisticated techniques are grouped by chapter.  For example, Chapter 3 considers frames and multiple windows.  There is an illustration of the cliché design of a control bar along the left edge of a Web page that redirects content among various windows.  Code is included for collapsing frames and resetting them and ensuring that a certain frame is always on top.  The chapter includes rotating images and page loads using setTimeout().   It finishes with a script that scrolls a wide image left and right.  The cumulative effect of the chapter is the author has control over Web pages:  pages that relate, pages that nest on top of each other, pages that scroll left and right.

 

Chapter 9 illustrates use of the Document Object Model and the manipulation of named document parts.   This technique combined with Cascading Style Sheets and layers permits the development of dynamic tool bars, drop-down menus and sideways sliding presentations.  Chapter 10 presents a scrolling clipping window in a code cliché that is only a page and a half.

 

Appendices include common JavaScript objects, event handlers, and a Cascading Style Sheets style guide.  I recommend this book for every Web author.  It would make an excellent textbook for introducing scripting as a tool for novice Web designers.

 

Terrence A. Brooks

Information School

University of Washington

tabrooks@u.washington.edu