About the Author
Schalk Neethling lives in Pretoria, South-Africa where he runs the new media studio Volume4. His work is focused on designing and developing cross-browser, standards based websites and web applications for his clients. In his daily work he uses XHTML, CSS, JavaScript, MySQL and Java to create solutions for his clients and has recently released beta versions of Volume4´s open source AlliedBridge CMS and Doc-Central document exchange systems both of which make extensive use of Ajax.
Spotlight Features

The Rich Engineering Heritage Behind Dependency Injection

Andrew McVeigh takes us on a tour of the rich heritage behind dependency injection, what it represents, and tells us why its here to stay.

NetBeans 6: Matisse Updates

NetBeans 6 delivers great updates to the Matisse GUI builder. Spend a few minutes with Roman Strobl and get an expert briefing on what's new and what has changed.

Introduction to Groovy Part 3

In this, the third and final installation of Andres' Introduction to Groovy series, you learn about how Groovy handles variable numbers of arguments, named parameters, currying, and more about Groovy operators. Including, some new operators.

Easier Custom Components with Swing Fuse

Swing Fuse (actually just Fuse), is a framework designed to make it easier to create your own custom desktop components. In this article, Daniel Spiewak shows you how to get started and provides sample source code you can download.

Benchmark Analysis: Guice vs Spring

Willam Louth shows how he uses JXInsight Probes to investigate probable performance issues with code bases that he is not familiar with. He also highlights possible pitfalls in creating a benchmark, as well as in the analysis of results.

Foundations of Ajax

Authors: Ryan Asleson and Nathaniel T. Schutta
Publisher: Apress Publications Co.
Date of publication: Oct 2005
Reviewer: Schalk Neethling

Intro, what is the main purpose of this book? Who is the intended audience?

“Foundations of Ajax” is exactly what the title says. It is intended for anyone and everyone who wishes to delve into the realm of the XMLHttpRequest (XHR), JavaScript and DOM world (popularly known as Ajax) and build a solid foundation from which to jump-start your own Ajax development. Although it does start from the beginning, some knowledge of the elements of Ajax will be a plus.

Summary of TOC/Sections

The book consists of the usual suspects. The about, acknowledgements and an introduction, after this follows seven chapters that explore the different areas of Ajax and Ajax development. It closes out with an eighth chapter that aims to 'Put it all together'. The book ends of with two appendixes covering cross browser JavaScript and an introduction to Ajax frameworks respectively.

The Chapters

Chapter 1 — Introducing Ajax

This chapter takes you through a quick journey of the history of the web and the web application and details how and why we are at the place we find ourselves at now.

Chapter 2 — Using the XMLHttpRequest(XHR) Object

This chapter explores the XHR object and goes over a bit of history on how people in the past mimicked the functionality of XHR using remote scripting and iFrames. It then moves on to introduce the XMLHttpRequest object and shows how it is implemented in the different modern browsers.

The chapter concludes with a simple request example to demonstrate how a request is made and the result displayed. NOTE: It may seem obvious but, you need to run these code examples from day 1 via a server environment such as Apache or Tomcat when trying out the code samples.

Chapter 3 — Communicating with the Server: Sending requests and processing responses

This chapter covers the aspects of the response and request in Ajax and using innerHTML to dynamically ad content to the DOM. It discusses the actual process of implementing this as well as the data transfer formats available. Later in the chapter it also discusses the positives and negatives of the two most popular transfer methods namely XML and JSON.

Chapter 4 — Implementing basic Ajax techniques

With this chapter you really can start to get your hands dirty with coding actual Ajax samples. Some of the most searched for Ajax techniques are covered here such as, form validation, auto complete, displaying a progress bar, creating tool tips and much more.

Chapter 5 — Building the Ultimate Ajax developer´s toolbox

You want to develop Ajax right? You know from past experience that this is probably going to be a personal hell of JavaScript browsers sniffers, browser specific code and trying your utmost to debug and test all of this. Right? I am happy to say, WRONG!

JavaScript tools have come a long way. Even though there is no dedicated IDE there are a lot of tools out there that can make your job easier. The book does a great job of discussing these such as the Firefox DOM inspector, JSDoc, HTML validator and various other Firefox extensions. I use most of these tools on a daily basis and definitely learnt something new in this chapter. Also under discussion are various advanced JavaScript techniques such as OO JavaScript using prototype, private properties and information hiding.

Chapter 6 — Testing JavaScript with JsUnit

A lot of developers will be very happy when they read this chapter. If you are used to testing your Java code with JUnit, you will be happy to hear you can now do the same thanks to a port of JUnit called JsUnit. This chapter discusses the ins and outs of testing your code using JsUnit also showing similarities and differences between JsUnit and the other xUnit test tools.

Chapter 7 — Exploring JavaScript debugging tools and techniques

This chapter starts out by discussing the very popular ‘Greasemonkey’ extension for Firefox and how it can be used to actively monitor Ajax request and responses and debugging your code effectively using the available user scripts. It then moves on to discussing how to use the JavaScript Console in FF and the Script Debugger in IE to track down your JavaScript bugs. Personally I feel the script debugger in IE creates more frustration then actually providing help. But if you do not have access to Firefox it is the only alternative. Lastly the chapter discusses the Firefox extension Venkman but, since the book was published a lot has happened in this space and Venkman has now been replaced by the amazing Firebug extension for Firefox.

Chapter 8 - Putting it all together

In this final chapter the authors start out by discussing common pattern already implemented by some of the most popular websites and applications on the web today. To discuss each of these in detail might be beyond the scope of the book but, I do feel that a little more could have been covered here, maybe even some basic code samples would have been great.

Following patterns they move on to a discussion of frameworks but in reality they only discuss one, the Taconite framework. The authors of this book are also the co-creators of the Taconite framework and as such give a great deal of in-depth explanation of its uses to overcome common Ajax and JavaScript problems and speed up development time. The Taconite framework does look like a very good and well worth investigating framework but, I would have liked some comparative code illustrations showing how other frameworks handle similar situations.

Appendix A and B

The book closes with two appendixes, the first covering cross-browser JavaScript and the second giving a round up of client side and server side framework. Appendix A will definitely save you a lot of time and headaches as it covers most of the day to day problems you will encounter when testing your code and finding it to work everywhere but in IE. It details the problem and then shows you the work around. A very valuable chapter.

Conclusion

All and all this is a very helpful and useful publication. I believe the authors were successful in achieving what they set out to do, provide you with the foundation needed to jump start your Ajax development. There are some great code samples in the book and it has already helped me to implement a couple of features into one of my own Java apps and debug and test it successfully.

Readers who do not come from a Java background and who does not use Java as their server side language of choice might feel that the book is a little to focused on this area but, as the authors do mention, the techniques in this book can be applied to any server side technology and therefore this book will still be a valuable addition to any coder's library. With all of that said my rating for this title would be 7/10.

Check out Foundations of Ajax on the Apress website.

Purchase Foundations of Ajax on Amazon and help Javalobby.