An Outstanding Guide to JavaScript and jQuery

jQuery is open source at its finest. It’s a fast and small JavaScript library that streamlines things HTML document traversal and manipulation, event handling, animation and Ajax. It offers a simple API that works across browsers. It’s great.

But for those of us who’ve used it book cover: Murach's javascript and jquery infrequently over, the documentation isn’t the easiest to work with. Oh, sure, it’s complete and includes a lot of examples, but it usually takes me an hour or two of Web searching to find a good instance of what I need. Plus, to get the best out of it, you have to be up to speed with JavaScript.

I developed a Web app with 36 persistent screen objects that can be dragged and dropped and got that working using the jQuery UI, but it was a painful learning experience and took longer than expected. Murach’s JavaScript and jQuery, by Zak Ruvalcaba and Mike Murach, would have helped me enormously by filling in the gaps of my JavaScript and jQuery knowledge.

There are quite a few jQuery books out there to fill this hole, but most assume that you already know JavaScript. This one doesn’t. It begins with a crash course in JavaScript — a crash course which occupies almost 200 of the book’s 564 pages, and six of its 18 chapters. If you’re not up to speed on programming with JavaScript, you will be by the time you’re done.

This is a practical book with many examples and a layout that makes it easy to follow. Topics are done in pairs. Everything about the topic, including syntax and “How to do…” is on the left page, while the right page lists the code. HTML and CSS are covered, with plenty of explanations, in the introduction.

Learning JavaScript

Murach’s JavaScript and jQuery would be an excellent text for a college-level course. The introductory chapters cover Web applications right from fundamentals like Web servers, networking and the Internet, describing in some depth how static and dynamic pages are served up. Then it explains JavaScript’s role as a scripting language in the browser, plus how jQuery fits in.

Examples include a mail client, which shows the HTML, CSS, JavaScript and use of jQuery to provide validation. The book uses HTML5 so it’s bang up-to-date, and some of the newer elements such as header, section and footer are all used and explained. The CSS introduction is very short, but covers enough for non-designers.

Aptana IDE

For developing and running JavaScript, the authors recommend the free Aptana Studio IDE shown above. It’s not needed for running JavaScript, as you can just open HTML files containing JavaScript in any browser. But if you intend to develop and debug JavaScript, it’s worth installing. Another Eclipse-derived IDE, it’s available as a standalone or a plugin for Eclipse 3.6+.

The standalone Aptana Studio 3 is also cross-platform, and the Windows version takes up 260 MB when installed. If you also intend to do PHP, Python or Ruby development, you’ll find it useful.

Learning JavaScript starts in chapter two, which hits the ground running and covers from comments, variables loops and lots more, ending with a couple of examples. Each chapter ends with a list of terms you should know, a summary of its key points and a set of exercises to do.

The fun continues with objects, functions and events in chapter three, testing and debugging in chapter four, arrays in chapter five, and finishes with scripting the DOM with JavaScript.

I found the testing and debugging chapter particularly valuable. It covers the use of Firefox and Firebug and lists common and syntax errors. Fixing these kinds of problems can be time-consuming very and frustrating when you’re just starting out, so this coverage is very helpful.

DOM scripting might appear a bit advanced for a JavaScript book, but it’s pertinent for the jQuery part. This chapter also introduces jQuery and by illustrating how to write an FAQ Web application with or without jQuery, it demonstrates why the library is so powerful.

On to jQuery

The real meat is in the remaining two thirds of the book. It’s all about jQuery, jQuery UI, Ajax, JSON, APIs and jQuery Mobile. Chapter seven has a lot of material on jQuery, and if it’s new to you, it will take some re-reading and running examples for it to start making sense. The applications created in the previous chapter are redone with jQuery, with a detailed explanation of why.

Chapters eight through 11 offer a number of examples covering effects and animation, DOM manipulation, forms and data validation and plugins. Of these I guess chapter 10 will be the most useful, as it’s about forms and data validation. Client-side validation should be seen as something to help users, but don’t forget server side-validation for your site’s security.

jQuery UI

jQuery’s animation effects and drag-and-drops all come its sister library, jQuery UI. Chapters 12 and 13 cover the use of themes, widgets and using UI interactions and effects. Using the jQuery widgets and interactions give websites considerable Wow! appeal, and chapter 13 covers it in some depth with plenty of examples.

Ajax

Though Ajax has been around for 7 or 8 years, jQuery makes it easy to implement it. Chapter 14 covers loading the various data types (XML, JSON), while chapters 15 and 16 show how to use Ajax with YouTube, Twitter, Flickr and Google Maps with useful and  practical examples.

jQuery Mobile

Finally, the last two chapters show you how to use jQuery Mobile to serve up mobile-friendly versions of your website. Given the massive growth in smartphone Internet access, this is an area you’d can’t afford to miss out on.

Conclusion

This is a book for everyone from complete novices to experienced Web developers, as well as people like me who occasionally have to do some Web development work but forget everything in between gigs. If you want to get up to speed with jQuery, or need a reference/recipe book, I recommend this one very highly, rating it five out of five stars.

Murach’s JavaScript and jQuery, by Zak Ruvalcaba and Mike Murach
Paperback, 764 pages. Mike Murach & Associates

Comments

  1. BY Anthony Freund says:

    Read this book a few months ago when trying to bridge the gap between the mobile native to mobile web camps and found it a very helpful book, along with some good reads on HTML5, CSS3, and mobile architecture.

    Highly recommended for anybody. Great teacher for sure!

  2. BY anupama says:

    A good one

Post a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>