Skip navigation.

AJAX Mistakes

Alex Bosworth has compiled a list of Ajax Mistakes. It starts off a bit too negative "Javascript itself is a dangerous UI technology" (err, so is driving a car), but I agree with his critique.

We use the JSRS library. The first problem "Not giving immediate visual cues for clicking widgets" does not happen with JSRS because the browser downloading button does spin when an AJAX query is running.

From my point of view, the toughest problem with AJAX is the increased complexity.

We do 99% of our database-backed forms in phpLens (see this phpLens AJAX example). In phpLens, we allow changes in the fields of a form to trigger changes in other fields. For example, select a new product from a menu in a shopping cart, and the price field updates by performing an AJAX query and the quantity field is reset to 1. Changes can cascade, so if the quantity or price fields change, the total value will change too! Ensuring that the updates don't loop infinitely or lock wrongly is tricky. This is because phpLens doesn't have the luxury of hard-coding the order of execution, as it is a dynamic tool. We use a state machine written in Javascript to figure out what needs to be updated safely.

Brent Ashley, author of JSRS has blogged about the recent AJAX summit. Also see Building Rich DHTML Apps.