Các bước từ 1 đến 5 là một điển hình HTTP yêu cầu. Sau khi thực hiện các yêu cầu, người sử dụng cần phải chờ đợi cho đến khi trang được nạp. Với các ứng dụng web thông thường (không có AJAX), chẳng hạn một trang tải lại xảy ra mỗi khi khách hàng cần phải có được dữ liệu mới từ máy chủ. | AJAX and the Future of Web Applications Figure shows the actions that happen when running this application user user uses web browser to access index-html - web client web browser makes normal - HTTP request to web server requesting web server server responds to the call by - sending back and the JavaScript file quickstartjs that is referenced in on the page the user starts typing his her name A i client loads and quickstartjs and composes the page on the screen quickstartjs makes an asynchronous call to on the server on behalf of the user is executed on the server and returns the results in XML format user s page is updated with new data while user continues working on the page quickstartjs receives . response from the server and uses the data to update user s display Figure The Diagram Explaining the Inner Works of Your Quickstart Application Steps 1 through 5 are a typical HTTP request. After making the request the user needs to wait until the page gets loaded. With typical non-AJAX web applications such a page reload happens every time the client needs to get new data from the server. Steps 5 through 9 demonstrate an AJAX-type call more specifically a sequence of asynchronous HTTP requests. The server is accessed in the background using the XMLHttpRequest object. During this period the user can continue to use the page normally as if it was a normal desktop application. No page refresh or reload is experienced in order to retrieve data from the server and update the web page with that data. Now it s about time to implement this code on your machine. Before moving on ensure you ve prepared your working environment as shown in Appendix A where you re guided through how to install and set up PHP and Apache and set up the database used for the examples in this book. You won t need a database for this quickstart example. 20 Chapter 1 All exercises from this book assume that you ve .