Home / Advanced JavaScript Tutorial / "JavaScript & DHTML cookbook" review


 

CodingForums
Having trouble with scripting? Visit our help forum to get the answers you need.

Jump to...
-Free JavaScripts
-JS tutorials
-JS Reference
-DHTML/CSS

-Free applets
-Web Tutorials
-Link to Us!


"JavaScript & DHTML cookbook (April 2003)" review
Book review by Ada Shimar

Ok, so I was reluctant when I first picked up and started reading O'Reilly's "JavaScript & DHTML cookbook". After all, I'm fairly proficient in JavaScript already (yes, get in line to hire me!), and if I needed some cool DHTML scripts, I could just visit a good site like Dynamic Drive. However, the book managed to both surprise and impress me, a great combination to have in a book.

I'll begin my review by making a bold statement- if you've read and like O'Reilly's Definitive Guides on JavaScript and DHTML, you'll adore this book. I use the word "adore" very deliberately here, because in my opinion  "JavaScript & DHTML cookbook" is much easier to love than the gigantic and sometimes monotonous Definitive Guide series. "Why you ask?" Lets see- the book is compact (some 500 pages), concise, and filled with the essence of JavaScript and DHTML as far as what you can create using the language/ technology.

"JavaScript & DHTML cookbook" is broken up into 15 chapters, each containing a series of recipes. The chapters are:

1. Strings
2. Numbers and Dates
3. Arrays and Objects
4. Variables, Functions, and Flow Control
5. Browser Feature Detection
6. Managing Browser Windows
7. Managing Multiple Frames
8. Dynamic Forms
9. Managing Events
10. Page Navigation Techniques
11. Managing Style Sheets
12. Visual Effects for Stationary Content
13. Positioning HTML Elements
14. Creating Dynamic Content
15. Dynamic Content Applications

These chapters are used mainly to facilitate the look up of a particular recipe, as each recipe exists and is explained independent of one another. This is consistent with the style of most Cookbooks, and it seems to work well here as well.

If  you're a complete novice, you may be wondering at this point the distinction between JavaScript and DHTML. The book doesn't make a conscious effort to differentiate between the two when discussing recipes, and for a good reason. DHTML is basically JavaScript, though the later draws in your page's HTML and often CSS as well to create something more encompassing.

Ok, to what's important now- the recipes themselves. I was expecting a series of flashy, long and "tacky" JavaScripts you can find in the source of every other site on the web these days, padded with some nonsense accolade like the web cannot survive without them. Such scripts are mostly counterproductive and do little to educate a JavaScript learner, let alone a master like myself (hur hur). To my delight, things were the complete opposite. The recipes in "JavaScript & DHTML cookbook" are extremely practical, well thought out, and even educational. Discussions like "Calculating the Number of Days Between Two Dates", "Simulating a Hash Table for Fast Array Lookup" and "Transforming XML Data into HTML Tables" not only are very useful to the cut-and-paster, they teach even seasoned JavaScripters a thing or two about the language.

The only minor compliant I have with this book is the length of some of the script examples- they span a little too long to follow effortlessly. The longest script I can recall in the book runs about 5 pages in length. Fortunately, such recipes are few and far in between, and 95% of the recipes are extremely short in length and packed with useful information and techniques. For the long scripts, it's easy to discern they exist out of necessity to create and show a fully functional script rather than just to pad pages.

In summary, I walk away from reading "JavaScript & DHTML cookbook" with many new tricks up my sleeve, something I had not expected at all. Some good resources online that compliment the reading would be DevEdge's JavaScript Reference and JavaScriptKit's JavaScript tutorials. 8.5 out of 10.

-"JavaScript & DHTML cookbook" (from Amazon).

http://www.javascriptkit.com
Copyright 1997-2005 JavaScript Kit. NO PART may be reproduced without author's permission.