<a href="http://www.micropoll.com/akira/mpview/585320-168921">Click Here for Poll</a><a href="http://www.questionpro.com" title="online surveys">Online Survey</a><BR> | <a href="http://www.micropoll.com" title="Website Polls">Website Polls</a><BR> | <BR><a href="http://www.micropoll.com/akira/MicroPoll?mode=html&id=168921">View MicroPoll</A></div>

Visual Studio 2010!

Read now >

Windows Mobile Development Thoughts

Read now >

View Now
DevSource RSS FEEDS
XML Want an easy way to keep up with breaking tech news? And the Get DevSource headlines delivered to your desktop with RSS.
ADVERTISEMENT
ADVERTISEMENT

 

ADVERTISEMENT
Review of JavaScript: The Missing Manual
By Lynn Greiner

Rate This Article: Add This Article To:

Review of JavaScript: The Missing Manual, by David Sawyer McFarland. O'Reilly/Pogue Press 2008. $39.99. ISBN: 978-0-596-51589-8.

Once upon a time, long, long ago, software actually came in a box, with disks and (gasp) even a manual. That's right – we weren't always expected to learn by blundering around and poking about in Help menus.

Sigh … those were the days!

Actually, thanks to O'Reilly's Pogue Press, those are still the days. Although we rarely see either a box or a manual from a software publisher any more, the Missing Manual series attempts to pass on the information we would have received before penny-pinching took over and deprived us of enlightenment from programs' authors (or, in some cases, it provides us with coherent enlightenment when the program's author is better with code than with explanations).

JavaScript: The Missing Manual, by David Sawyer McFarland, does double duty. Not only does it explain the basics of JavaScript, it explores the JQuery library, recently adopted by several developer tool vendors, including Microsoft. JQuery will be prominently featured in the next version of Visual Studio, a nice incentive to hone your skills in it now.

In fact, some critics have complained that the book provides a bit too much JQuery and not enough raw JavaScript.

They obviously never met my grade 12 math teacher, who maintained that good mathematicians are lazy; they want to find the most elegant solution to problems to spare themselves unnecessary effort. Similarly, I believe that good developers are lazy, for the same reason. If there's a good library or framework around that lets the developer meet his or her goals with less effort, saving brainpower and typing fingers for other, more pressing issues, it's smart to use it.

Nuff said – back to the book.

As always in this series, the book begins by enumerating the assumptions about the reader's skill level: knowledge of HTML and CSS, and of basic computer operations. But just in case there are some gaps, textboxes sprinkled throughout titled "Up to Speed" fill them in. And if the reader is a power user, there are additional tips for him or her as well.

Part one then starts you out with the same thing virtually every language tutorial does: a routine to output our old friend, "Hello World". As well as looking at the printed code samples (and there are a lot of those sprinkled through the volume), you can download a full set of files containing the shell for each exercise, along with its results, from McFarland's website: http://sawmac.com/missing/javascript/tutorials/index.php.

Yes, you are encouraged, nay, expected, to fire up your text editor and do those exercises. McFarland provides a list of suitable editors, both free and otherwise, in case you don’t have one already. He also explains how to set up a local Web server on Windows or Macintosh.

After a couple of simple examples, the next step is a short debugging lesson (McFarland likes FireFox's JavaScript console, since for version 7 and below, Internet Explorer's console was virtually useless; when he wrote the book, Internet Explorer 8, with its enhanced developer tools, was not yet available).

Following that, there's a chapter on JavaScript syntax that wanders through basics such as variables and arrays. The next chapter segues into control structures, finishing up with instructions on how to code a simple function.

Regular expressions, strings, numbers, dates and objects receive attention next. Then, with a little help from the document object model (DOM), you create a quiz, complete with scoring mechanism. However, says McFarland, the DOM has problems that make it less than ideal for use on the Web. It takes a lot of donkey work to get around those issues.

That's where libraries come in, specifically, the aforementioned JQuery library.

If you're counting, we're now midway through chapter five. From here through chapter twelve, prepare to get cozy with JQuery.

We start with simple stuff: filters, selectors and some fun with CSS. Then we move on to event management, effects, and some cool ways to play with images, and finally use JQuery components to create a slide show.

Forms are next, with a heavy dose of error checking, and then we start fiddling with the user interface, constructing collapsible menus known as accordions. McFarland takes advantage of them to talk about the JQuery UI project, which offers a whole herd of plug-ins to simplify the construction of elements such as dialog boxes, tabs, and accordions.

He then gets into tabs and tooltips and sortable tables before diving into Ajax the JQuery way, with a small detour through JSON. A large chunk of chapter twelve is devoted to the ins and outs of incorporating Google Maps into your site.

Finally, probably the most important chapters in the book – troubleshooting and debugging, followed by a chapter on optimizing and creating more efficient code. McFarland lists many of the most common programming bloopers to help developers of all experience levels bypass those irksome moments when programs blow up. We then wind up with seven pages pointing to additional references.

So is this the definitive guide to JavaScript? No, not really – it'll take a much fatter volume to accomplish that. But it will get you going, and it will give you a nice primer in JQuery on the way by. And by the time you get through the exercises, you'll be able to produce some interesting client-side apps, and be ready to spread your programming wings.




Discuss Review of JavaScript: The Missing Manual Review
 
>>> Be the FIRST to comment on this article!
 

 
 
>>> More Microsoft Languages Articles          >>> More By Lynn Greiner