What is AJAX?
Normally, a web page must be refreshed to view new information. For example, when you fill out an online form such as a credit card purchase online, some sites need you to click next to let you know if you filled out something incorrectly. However, with AJAX, not only can the form let you know if you filled out something incorrectly, but it can also let you know if you've already made a previous purchase, or if your credit card was expired. Another example of useful AJAX is viewing online maps. Before AJAX, Google Maps required you to click the arrows to navigate their maps, and the page had to reload in order to see the new portion of the map you were interested in. However, Google Maps now utilizes the power of AJAX to fetch the new portions of the map and "redraw" the page where the map moves.
If you already know about Ajax, and want to use it in a plugin you are developing, skip to AJAX in Plugins.
How does Ajax work?
Ajax in WordPress
Because of its responsiveness, Ajax technology is being adopted by all sorts of websites -- and WordPress is no exception. Currently, the core of WordPress uses Ajax only in the administration screens. For instance, Ajax is used for instant updates when you are doing comment moderation, and when you are adding and deleting items from lists such as categories, blogroll, and posts; Ajax is also the technology behind the auto-save functionality on post and page editing screens. Several themes and plugins also use Ajax; for instance, some post rating plugins use Ajax to store the visitor's rating in the database and then display an updated average rating.
- Codex - Ajax in Plugins - WordPress-specific information on how to add Ajax to plugins
- WP_Ajax_Response Class Reference - Responding to Ajax requests
- Working Examples of Ajax
- Simplified Ajax - SAJAX
- "Eleven Emerging Ideas for SOA Architects in 2007" from Hinchcliffe.org; "This allows widgets, Ajax applications, and mashups to be wired together so quickly it can almost be done in real-time with the latest tools."