The Art & Science of JavaScript
By James Edwards, Christian Heilmann, Michael Mahemoff, Ara Pehlivanian, Dan Webb, Simon Willison & Cameron Adams
The Art & Science of JavaScript assembles seven of the greatest minds in modern JavaScript to teach you the most inspirational techniques you'll ever use. From creating impressive mashups and stunning, dynamic graphics, to more subtle user-experience enhancements, you're about to be amazed by the true potential of this powerful language. You won't find a better line-up of JavaScript experts. Between the seven authors you'll already find loads of books, a huge list of achievements and years upon years of dedication to JavaScript. If your wondering how they program JavaScript in heaven, you've just found the stairway.
Among its many treasures, this book will show you how to:
- Create a slick Google Maps and Flickr mashup
- Build your own fully accessible 3D maze
- Have some fun with draggable and sortable table columns
- Give your site some extra personality with client-side badges
- Write better code faster using metaprogramming techniques
- Create stunning vector graphics using the canvas element
- Become a debugging expert using pro-level Firebug tricks
...and much more besides!
What's in the book?
Chapter 1: Fun with Tables
HTML tables get a bad rap among web developers, either because of their years of misuse in page layouts, or because they can be just plain boring. In this chapter, Ara Pehlivanian sets out to prove that not only are properly used tables not boring, but they can, in fact, be a lot of fun.
Chapter 2: Creating Client-side Badges
Badges are snippets of third-party data (image thumbnails, links, and so on) that you can add to your blog to give it some extra personality. Christian Heilmann walks us through the task of creating one for your own site from scratch, using JSON and allowing for a plan B if the connection to the third-party server dies.
Chapter 3: Creating Vector Graphics with canvas
In this chapter, Cameron Adams introduces the canvas element, and shows how you can use it to create vector graphics — from static illustrations, to database driven graphs and pie charts — that work across all modern browsers. After you've read this chapter, you'll never look at graphics on the Web the same way again!
Chapter 4: Debugging and Profiling with Firebug
Firebug is a plugin for the Firefox browser, but calling it a plugin doesn't do it justice — Firebug is a full-blown editing, debugging, and profiling tool. It takes the traditionally awkward task of JavaScript debugging and optimization, and makes it intuitive and fun. Here, Michael Mahemoff reveals tons of pro-level tips and hidden treasures to give you new insight into this indispensable development tool.
Chapter 5: Metaprogramming with JavaScript
Here, Dan Webb takes us on a journey into the mechanics of the JavaScript language. By understanding a little about the theory of metaprogramming, he shows how we can use JavaScript to extend the language itself, improving its object oriented capabilities, improving support for older browsers, and adding methods and operators that make JavaScript development more convenient.
Chapter 6: Building a 3D Maze with CSS and JavaScript
Just when you thought you'd seen everything, James Edwards shows you how to push the technologies of CSS and JavaScript to their limits, as he creates a real game in which the player must navigate around a 3D maze! Complete with a floor-plan generator and accessibility features like keyboard navigation and captions, this chapter highlights the fact that JavaScript's potential is limited only by one's imagination.
Chapter 7: Flickr and Google Maps Mashups
Ever wished you could combine the Web's best photo-management site, Flickr, with the Web's best mapping service, Google Maps, to create your own uber-application? Well, you can! Simon Willison shows that, by utilizing the power of JavaScript APIs, creating a mashup from two third-party web sites is easier than you might have thought.