Feeds

Ajax Hacks

Playing with AJAX

The essential guide to IT transformation

Book review Everybody loves Ajax. Javaists, Rubyists, Pythonistas; even Microsofties get to play with Ajax in the form of Atlas. Book publishers love Ajax too, judging by the stack of new titles coming hot off the presses.

O'Reilly has added to the pile with a new title in their long-running "Hacks" series. The aim of the series is to present developers with a series of hacks, tricks, tips and gee-whiz moments. Think of it as a good place to dip-in for ideas, examples and code that can be lifted and re-worked for your own projects. Each book presents a numbered sequence of these "hacks", organised thematically so that readers can easily home in on the topics they're interested in.

With a relatively new technology like Ajax there are going to be many readers picking the book up with little prior knowledge or understanding of how it all works. Therefore, the first chapter of the book is devoted to explaining how Ajax implements asynchronous communication between the browser and server, and where JavaScript and XML fit into all this. It discusses the document object model, browser incompatibilities, alternatives to XML (in the form of JSON) and so on. In short, you have all the elements of an introductory tutorial; however, it is broken up into a sequence of "hacks" – which is a structure that doesn't really work in this case.

The next two chapters – web forms and field validation – are also largely tutorial in nature. They pick up from the basics and present code to actually do some useful bits and pieces for creating forms and validating fields on the fly. It's at this point that the appeal of Ajax really becomes clear – no more having to round-trip to the server to check that users have entered valid credit card details, email addresses etc.

The gee-whiz element really kicks in with chapter four's collection of mash-up hacks for dynamically aggregating content from Google, Yahoo and other sites. Where novice Ajax programmers will find the first few chapters most useful, it's here that more experienced developers are likely to get excited.

From then on, the book focuses on some of the other technologies and libraries that work with Ajax. The first of these is the DWR (direct web remoting), which enables Java developers to easily map between Java objects on the server and JavaScript code on the client side. Ruby developers shouldn't feel left out as they get a chapter on using Ruby on Rails with Ajax. And for JavaScript there are chapters that look at Rico, Prototype and the script.aculo.us libraries.

The final chapter looks at some of the more thorny issues that Ajax applications have to deal with. For example, what does the back button do when your application is hosted pretty much on a single web page? In a data-heavy application, hitting the back button could cost your users a lot of lost work. This and other deployment issues get hacks devoted to them in this closing chapter.

While there's a lot to commend the book, there are a couple of things to note. The first is that this is clearly not the best book for someone wanting to learn Ajax from scratch. Ajax In Action (reviewed here), provides a more thorough grounding. Secondly, this is a fast moving area of software development with new tools, techniques, and libraries emerging all the time, so there's something of a timeliness issue to bear in mind.

Ajax Hacks

Verdict: While not the ideal beginner's book, it has some good ideas and is designed to appeal to a range of developers wanting to get in on some Ajax action.

Author: Bruce Perry

Publisher: O’Reilly

ISBN: 0596101694

Media: Book

List Price: £20.99

Buy this book at Register Books, at Reg Developer's special discounted price. ®

Secure remote control for conventional and virtual desktops

More from The Register

next story
Munich considers dumping Linux for ... GULP ... Windows!
Give a penguinista a hug, the Outlook's not good for open source's poster child
The Return of BSOD: Does ANYONE trust Microsoft patches?
Sysadmins, you're either fighting fires or seen as incompetents now
Microsoft cries UNINSTALL in the wake of Blue Screens of Death™
Cache crash causes contained choloric calamity
Time to move away from Windows 7 ... whoa, whoa, who said anything about Windows 8?
Start migrating now to avoid another XPocalypse – Gartner
You'll find Yoda at the back of every IT conference
The piss always taking is he. Bastard the.
HANA has SAP cuddling up to 'smaller partners'
Wanted: algorithm wranglers, not systems giants
prev story

Whitepapers

Endpoint data privacy in the cloud is easier than you think
Innovations in encryption and storage resolve issues of data privacy and key requirements for companies to look for in a solution.
Implementing global e-invoicing with guaranteed legal certainty
Explaining the role local tax compliance plays in successful supply chain management and e-business and how leading global brands are addressing this.
Top 8 considerations to enable and simplify mobility
In this whitepaper learn how to successfully add mobile capabilities simply and cost effectively.
Solving today's distributed Big Data backup challenges
Enable IT efficiency and allow a firm to access and reuse corporate information for competitive advantage, ultimately changing business outcomes.
Reg Reader Research: SaaS based Email and Office Productivity Tools
Read this Reg reader report which provides advice and guidance for SMBs towards the use of SaaS based email and Office productivity tools.