AJAX Web Programming, Part II

How does AJAX work? In a non-AJAX Web application, a user event such as a button click generates an HTTP request to the Web server. HTTP requests are synchronous, meaning that the Web browser client program waits until the Web server returns the HTTP response. During this time, the user cannot interact with the browser — any button clicks are ignored, which is often very annoying. AJAX uses a different mechanism. In an AJAX Web application, a user event generates a special XML-HTTP request. This is quite similar to an HTTP request except that an XML-HTTP request is asynchronous, meaning the request operates behind-the-scenes. This allows the user to keep interacting with the browser while the request is being processed by the Web server. When the XML-HTTP response is returned to the Web browser, the browser then updates the Web page. Additionally, when using AJAX, you can design your Web application so that only the part of the Web page which has changed (typically new data from the Web server) needs to be repainted. The result is that well-designed AJAX Web applications have dramatically improved performance compared to non-AJAX applications. AJAX only works with Web browsers which have full XML support. Currently this means Interne Explorer, Firefox, and Safari. But because AJAX is so popular, it shouldn’t be too long before most Web clients can take advantage of AJAX. Next time, I’ll describe testing AJAX Web applications.

This entry was posted in Software Test Automation. Bookmark the permalink.