Introduction
More than 40% of Web applications today use PHP as their scripting language. Asynchronous JavaScript and XML (Ajax) is a Web technique that combines JavaScript, Document Object Model (DOM), and XMLHttpRequest technologies to provide dynamic interaction between a client and a server. Various PHP class libraries are available for using Ajax with PHP. Xajax is an open source, object-oriented, PHP class library with which Ajax may be used with PHP.
As an example, suppose a user fills out a form to register with a Web site. The validity of data in the form is not checked until the form is submitted. With Ajax, the data added to the form is dynamically validated using business logic in a server application. Thus, a complete form does not have to be posted to the server to check to see whether or not the data in the form is valid. Asynchronous implies that the send() method of an XMLHttpRequest object returns immediately without the HTTP request being complete and the processing of the HTML/JavaScript page that initiated the request continues. As a result, a developer may find that a HTML/JavaScript page that initiates an XMLHttpRequest request may continue to be processed as the XMLHttpRequest object processes the HTTP response asynchronously.