266 CHAPTER 9 (Affordable web hosting) THE AJAX APPROACH TO
266 CHAPTER 9 THE AJAX APPROACH TO BROWSER SCRIPTING Understanding Ajax It s important to understand that Ajax is not a technology; rather, it s an approach to using other technologies in web applications. Ajax uses a combination of the following technologies: XML XMLHttpRequest object JavaScript XSLT XHTML CSS Explaining the Role of Ajax Components Each component within the Ajax approach has a specific role. Table 9-1 summarizes the role of each component. Table 9-1. The Role of the Technologies Used Within Ajax Applications Component Role XML Stores data. You can also use other text-based data formats. XMLHttpRequest object Allows data to be retrieved asynchronously from the server. JavaScript Allows loading and manipulation of data. XSLT Transforms XML content into XHTML. May also add sorting and filtering to data. XHTML Generates the interface for the application. CSS Provides styling for the XHTML content within the application. Figure 9-1 shows the interaction between these technologies. Start reading from the right- hand side of the diagram. Ajax redefines the role of the server and client compared with traditional web applications. As you can see from Figure 9-1, some of the logic and the interface management move to the client. The changes can be summarized as follows: The role of the server changes from interface building to provision of data. The client loads the interface only once, when the application first starts. Client-side functionality persists even as content changes. The application can easily respond to a range of client-side events. For example, in Google Suggest, suggestions occur in response to a user entering keystrokes. Changes appear to occur instantaneously, providing responsiveness similar to that found in desktop applications.
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.