small medium large xlarge

Pragmatic Ajax: A Web 2.0 Primer


Cover image for Pragmatic Ajax

Pragmatic Ajax

A Web 2.0 Primer



Now there’s no need for you to choose between the ease of deployment of a web page and the interactive features of a rich desktop application. Ajax redefines the user experience for web applications. Your application can provide a compelling user interface delivered plug-in free using modern web browsers. This book shows you how to make Ajax magic, exploring both the fundamental technologies and the emerging frameworks that make it easy.

About this Title

Pages: 296
Published: 2006-03-01
Release: P2.1 (2008-09-22)
ISBN: 978-0-9766-9408-3

A new approach to web development

Ajax turns static web pages into interactive applications. Now you can deploy rich-client applications to clients without sacrificing the easy deployment of web applications. But to many folks, Ajax seems difficult. That’s why we produced this book. As a Pragmatic guide, it strips away the mystery and shows you the easy way to make Ajax work for you.

We cover the the basics of DHTML, JavaScript, and the infamous XmlHttpRequest call. You’ll see how to add Ajax to existing programs, and design new applications to exploit the power of Web 2.0. Learn the three layers of Ajax framework, and when (and how) to use each. See how to create rich clients, use visual effects, add client-side validation, and handle forms. Write applications that degrade gracefully if clients don’t support JavaScript. And see how to integrate your Ajaxified clients into Java, .NET, and Ruby on Rails server frameworks.

Writing dynamic applications isn’t that hard. Folks are awed by Google Maps, but it isn’t rocket science (apart from the satellite pictures). As a special bonus, see how to implement your own Google Maps-like application using DHTML.

Contents & Extracts

  1. Building Rich Internet Applications with Ajax. What is Ajax. Why now? Whither now?
  2. Ajax In Action. What it means to Ajaxify a web application.
  3. Ajax Explained. Client-side JavaScript. DOM manipulation. Server access.
  4. Google Maps Made Easy. Folks are awed by Google Maps, but it isn’t rocket science (apart from the satellite pictures). See how to implement your own Google Maps-like application using DHTML.(partial extract…)
  5. Ajax Frameworks. Why you need a framework. Introduction to Dojo and Prototype. (partial extract…)
  6. Ajax UI, Part I. Using Ajax and JavaScript to provide a rich client user interface.
  7. Ajax UI, Part II. Standard patterns. Web forms and effects. A look at the things that you shouldn’t do when deploying Ajax applications. (partial extract…)
  8. Degradable Ajax. Degrading gracefully with old browsers, and browsers with JavaScript disabled.
  9. Debugging Ajax. Tools, techniques, and tricks.
  10. Server-side frameworks. Java, .NET, PHP, and Rails
  11. Beyond Ajax. Mozilla XUL, Microsoft HTA, Flash as an Ajax component.
  12. Ajax Futures. E4X, Canvas, SVG, JSON.


Justin Gehtland is a partner and co-founder of Relevance, a training and consulting company located in the Research Triangle, North Carolina. He has been an application developer since 1990, and a web application developer since 1995. His technology background includes all the usual suspects. He is currently focused on development using Ruby, .NET and Java.

Ben Galbraith is a frequent technical speaker, occasional consultant, and author of several technology books. He is a co-founder of, was recently Chief Technical Officer for Amirsys, and is presently a consultant specializing in enterprise architecture and Swing/Ajax development. Ben wrote his first computer program when he was six years old, started his first business at ten, and entered the IT workforce just after turning twelve. For the past few years, he’s been professionally coding in Java. Ben presides over the Utah Java User’s Group, is active in the Java Community Process, and tinkers on various open-source projects. He’s delivered over one hundred technical presentations in 2005 at venues including JavaOne, Java Symposium, and the No Fluff Just Stuff Java Symposiums.

Dion Almaer is the other founder of, the leading source of the Ajax community. Dion has been writing rich web applications from the beginning, and is a columnist on Enterprise Java topics at,,, and of course his blog at He enjoys writing, and speaking at events such as JavaOne, JavaPolis, TheServerSide Symposium, and the No Fluff Just Stuff symposium tour. He also participates on the Java Community Process expert groups, and the open source community as a whole.