X
Business

JavaScript and jQuery, book review: An instant classic?

Forget dry references and cheesy examples. This beautifully designed visual guide takes you from the basics to sophisticated JavaScript techniques for making websites interactive and engaging in a way that is, in itself, interactive and engaging.
Written by Mary Branscombe, Contributor
javascript-book-left
JavaScript and jQuery: interactive front-end web development • By John Duckett • Wiley • 640 pages • ISBN: 978-1-118-53164-8 • £26.99/€32/$39.99

The problem with learning programming is that it's an interactive, visual experience where you need to see what's going on and what your code is going to do. How do you do that in a book? John Duckett's web programming titles (this book onJavaScript development and the accompanying HTML and CSS guide) do a fantastic job of this.

Unlike most books, you don't have to wade through pages of acknowledgements, introduction and contents; the second page is a list of the chapters and a link to get all the code, followed by a page explaining all the clever visual tricks in the book.

JavaScript and jQuery is more like a mix of magazine and web page than a textbook, with image backgrounds to hold your interest that also turn out to be carefully chosen visual metaphors. These form a key part of Duckett's clear and practical explanation of what scripts are.

The book is peppered with illustrations, flowcharts, lists, labelled diagrams, infographics and colour-coded code. Some images repeat over several pages, adding extra information every time.

For example, an explanation of a concept like methods and the objects they act on starts simply, with a picture of an hotel and the cars parked outside it. As you turn the pages, the hotel and car objects gain first properties, then methods, then events. By the end of the chapter what would have been a complex and confusing diagram makes perfect sense because it's been presented well.

Beautifully designed

The strong design of this book works so well because of its high-quality paper and print, and because there's no gratuitous decoration. It's all beautifully designed to make the often-complex concepts of how JavaScript controls the browser delightfully simple. The accompanying text is equally clear and simple, full of useful similes such as thinking of Boolean data types as light switches that can be either on or off.

Subtle colour coding helps organise the information. Pages that have lots of visual information and colour coding use a black background to make it stand out; these cover topics from the basics of CSS rules and HTML elements to caching DOM queries and sorting arrays. The main reference pages have code snippets (HTML in Blue, CSS and pink and JavaScript in green) and an image showing you what that code does on a web page; the grey page tint distinguishes them from the white background pages that add extra information. Without thinking much about it, you can easily tell when you're learning about a concept and when you're finding out how to use it.

What you get from 'JavaScript and jQuery' is a comprehensive introduction that prepares you to go and find out more for yourself.

This division of information works just as well in the first half of the book, which covers core concepts (the basics of how JavaScript manipulates HTML pages and the JavaScript language,the Document Object Model, events that trigger code on a web page, Query, Ajax and a range of APIs) to the practical applications in the second half (which covers error handling and debugging, content layout, data sorting and filtering, and form handling).

There are dozens of places where you could get the code for image galleries organised with thumbnails or filtered by tags. JavaScript and jQuery doesn't just do a great job of explaining the scripts to do that — it does a great job of explaining every single element that makes up those scripts and dozens of others, down to the basics of JavaScript inside a browser.

Even at this length (the 640-page paperback is almost an inch-and-a-half thick), there isn't space to go into everything. Instead of trying to skim over all the APIs in HTML, Duckett goes into detail about just three (geolocation, web storage and history), while the pages on using the debugging tools built into Chrome, Firefox and IE give you just the basics for getting started. But what you get from JavaScript and jQuery is a comprehensive introduction that prepares you to go and find out more for yourself.

You'll get the most out of this book if you're familiar with the basics of programming and web page building, but you can go from the basics to sophisticated results step by step, using a book that's as beautifully designed as the websites it's teaching you to build. That's an unusual and appealing combination, which makes this title stand out in a very crowded market.

Read more reviews

Editorial standards