—Andrew Hedges, Tapulous
From the Author
My 10 Favorite Examples from this Book
These are ten of my favorites from the book. Note that many of these use new features of ES5 or of HTML5, and will only work in the newest browsers:
3) Example 9-16 defines a class hierarchy of abstract and concrete Set classes. This one is a favorite because it involves data types and API design. Chapter 9 includes a number of other Set examples, too.
4) Example 9-23 demonstrates the ES5 Object.defineProperty() method and defines a convenient way to inspect and modify the attributes of the properties of an object. It may not be practical, but I think it is a beautiful hack.
5) Example 15-10 is a simple stream-like API wrapped around the innerHTML property of an element. When you're generating text (a table, for example) for display it is sometimes easier to pass each chunk that you compute to a write() method than it is to concatenate it all together and set it on innerHTML.
6) Example 21-03 is an analog clock implemented as an SVG graphic with scriptable hands. I love client-side graphics, and this is a favorite of mine because making the hands rotate is so simple with SVG transforms.
7) Example 21-06 draws a fractal Koch snowflake using the
From the Back Cover
About the Author
Most helpful customer reviews
0 of 0 people found the following review helpful.
Good reference but dry
This is a good reference but I rarely pick it up. The latter part of the book is a huge index which you can find online anyway.
3 of 3 people found the following review helpful.
By Timothy Bozer
I thought I had kept up with things since the last version. This book clued me in to new, simpler techniques becoming practical solutions only now - now that IE7 is so clearly on the way out.
Much of the book was re-written. There were a few issues that remained a bit elusive after reading the previous version (V5) and V6 cleared them up for me.
After studying chapter 15 on scripting documents, I stopped the press and made a number of important updates to my utilities file - streamlining functions that heavily supported IE 7. I changed a number of my websites to no longer support IE7 - this book gave me the information and courage to do so (the author did not suggest such a move, but it only made sense to me after getting myself up-to-snuff on the modern DOM). My code is now faster and leaner and much much much easier to follow (and debug if ever necessary) by using up-to-date basic dom methodologies such as:
A. Element.prototype to add some important/simple dom navigation methods to all elements (next(), previous() ..)
B. cssClass property to more easily, efficiently, and accurately deal with element classes (whereas I had a lot of code to do these functions and avoid RegExp for efficiency, now my methods simply pass cssClass with a simple RegExp as a fallback for IE8/9 which don't support cssClass. My perspective now is to NOT provide robust fallback for old IE, but only minimal anticipating users will make the jump from IE8 directly to IE 10/11 when their old PCs finally crap out (for those who use IE).
C. use of "data-" element attributes, which allow HTML to validate. I used to wrestle with confusing multiple classes to pass data so my html would validate - or I'd write special server / js scripts to attach data to elements as JS objects after the page loaded.
These examples aren't particularly the new sexy HTML5 initiatives, but without this book it might have taken me years to learn of them and to understand them enough to actually put them into play. And by the way, the book does a good job explaining the many HTML 5 initiatives - but I would first scan the pages to see if they were practical for my use and whether they were widely supported. But it's the small, detailed, practical things used in work-a-day scripting that makes this book so important to me.
I can't say this is a book for beginners only because of its length (1000+ pages) - but after learning JS on my own I wish I had read V5 of this book first as the others I read were all either somewhat outdated or too skimpy in important areas. This is really the only one that I read that goes into detail on the practical application of JS in client side scripting. It's the only JS book I use a reference.
My only criticism is that the book includes an entire chapter on jQuery (65 pages). I don't see the need for re-learning jQuery given browsers are moving along nicely toward standards compliance anyway. But the book would still weigh almost as much without the jQuery chapter.
3 of 3 people found the following review helpful.
See all 343 customer reviews...
A Must-Read, 1,000+ page Book?! Yes!
Occasionally I struggle with some of the material presented, but I'm guessing that's because of my lack of exposure to anything C++, rather than the author's approach/delivery. In fact, Flanagan seems to anticipate a little struggling with concepts, and frequently (enough) slows the pace down so that dinosaurs like me can stay caught up, focused, and moving forward.
This might be a 5-starred book, but since I haven't finished it in the 30 days since purchase, it gets stuck with 4 stars for now. Nonetheless, one might ask: is David Flanagan the NEW Danny Goodman?? BUY RECOMMENDATION