Bản quyền © năm 2006 Packt Publishing Tất cả các quyền. Không có phần nào của cuốn sách này có thể được sao chép, lưu trữ trong một hệ thống thu hồi, hoặc truyền đi dưới bất kỳ hình thức nào hoặc bằng bất cứ phương tiện nào, mà không cần sự cho phép trước bằng văn bản của nhà xuất bản | AJAX and the Future of Web Applications http is a popular AJAX-related web blog. http article remote-scripting-ajax is Cameron Adams excellent article AJAX Usable Interactivity with Remote Scripting. http en docs AJAX is Mozilla s page on AJAX. http wiki AJAX is the Wikipedia page on AJAX. The list is by no means complete. If you need more online resources Google will surely be available to help. In the following chapters you ll be presented with even more links but more specific to the particular technologies you ll be learning about. Building a Simple Application with AJAX and PHP Let s write some code then In the following pages you ll build a simple AJAX application. This exercise is for the most impatient readers willing to start coding ASAP but it assumes you re already familiar with JavaScript PHP and XML. If this is not the case or if at any time you feel this exercise is too challenging feel free to skip to Chapter 2. In Chapter 2 and Chapter 3 we ll have a much closer look at the AJAX technologies and techniques and everything will become clear. You ll create here a simple AJAX web application called quickstart where the user is requested to write his or her name and the server keeps sending back responses while the user is writing. Figure shows the initial page index .html loaded by the user. Note that index .html gets loaded by default when requesting the quickstart web folder even if the file name is not explicitly mentioned. Figure The Front Page of Your Quickstart Application While the user is typing the server is being called asynchronously at regular intervals to see if it recognizes the current name. The server is called automatically approximately one time per second which explains why we don t need a button such as a Send button to notify when we re 18 Chapter 1 done typing. This method may not be appropriate for real log-in mechanisms but it s very good to .