Feeds

Ajax Hacks

Playing with AJAX

Top three mobile application threats

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. ®

Maximizing your infrastructure through virtualization

More from The Register

next story
HIDDEN packet sniffer spy tech in MILLIONS of iPhones, iPads – expert
Don't panic though – Apple's backdoor is not wide open to all, guru tells us
NO MORE ALL CAPS and other pleasures of Visual Studio 14
Unpicking a packed preview that breaks down ASP.NET
Captain Kirk sets phaser to SLAUGHTER after trying new Facebook app
William Shatner less-than-impressed by Zuck's celebrity-only app
Mozilla fixes CRITICAL security holes in Firefox, urges v31 upgrade
Misc memory hazards 'could be exploited' - and guess what, one's a Javascript vuln
Apple fanbois SCREAM as update BRICKS their Macbook Airs
Ragegasm spills over as firmware upgrade kills machines
Cheer up, Nokia fans. It can start making mobes again in 18 months
The real winner of the Nokia sale is *drumroll* ... Nokia
EU dons gloves, pokes Google's deals with Android mobe makers
El Reg cops a squint at investigatory letters
Chrome browser has been DRAINING PC batteries for YEARS
Google is only now fixing ancient, energy-sapping bug
prev story

Whitepapers

Top three mobile application threats
Prevent sensitive data leakage over insecure channels or stolen mobile devices.
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.
Application security programs and practises
Follow a few strategies and your organization can gain the full benefits of open source and the cloud without compromising the security of your applications.
The Essential Guide to IT Transformation
ServiceNow discusses three IT transformations that can help CIO's automate IT services to transform IT and the enterprise.