1.7. The Power of AJAX

Without the advanced use of JavaScript running in the browser, Web applications have their logic running on the server. This means many page refreshes for potentially small updates to the user's view. With AJAX, much of the logic surrounding user interactions can be moved to the client. This presents its own set of challenges. Some examples of using AJAX include streaming large datasets, managed entirely in JavaScript, to the browser. While JavaScript is a powerful language, the debugging facilities and options for error handling are very limited. Putting complex application logic on the client can take a lot of time, effort, and patience. AJAX as a whole allows you to naturally migrate some parts of the application processing to the client, while leveraging partial page rendering to let the server actually control some aspects of the page view.

Some Web sites make an application run entirely from a single page request, where JavaScript and AJAX will do a great deal of work. This presents some tough challenges. Users generally expect that the Back button will take them to the state of the application they were just viewing, but with AJAX applications, this is not necessarily the case. The client may be sending some information to the server for persistent state management (perhaps in server memory or a database), but this requires extra code and special attention to error handling and recovery.

The richest, most maintainable applications seem to be those ...

Get Professional ASP.NET 3.5 AJAX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.