Ajax is not a single technology, but a collection of four of technologies. Table 2-1 provides a brief overview of these technologies and the roles they play.
Table 2-1 key elements of Ajax
Javascript |
JavaScript is a common scripting language that is embedded in an application. The JavaScript interpreter embedded in the Web browser allows the program to interact with many of the browser's built-in features. Ajax applications are written using JavaScript |
CSS (cascading style sheets) |
CSS provides a way to define a reusable visual style for Web page elements. It provides a simple and powerful way to define and use visual styles in a consistent way. In AJAX applications, user interface styles can be modified independently by CSS |
Continued
DOM (Document Object model) |
The DOM presents the structure of a Web page as a set of programmable objects that can use JavaScript operations. Modifying a Dom,ajax application by using scripting can change the user interface at run time, or efficiently redraw a part of the page |
XMLHttpRequest objects |
The XMLHttpRequest object allows a Web programmer to obtain data from a Web server in the form of a later activity. The data format is usually XML, but it can also support any text-based data format (the XMLHttpRequest name is very inappropriate). Although XMLHttpRequest is the most flexible and versatile tool for completing this work, there are other ways to get data from the server. We'll discuss all the methods in this chapter. |
In the 1th chapter we see how Ajax provides users with complex, well-functioning applications that improve the user's interactive experience. JavaScript is like glue that glues parts together to define the workflow and business logic for the application. By using JavaScript to manipulate the DOM to change and refresh the user interface, continually redraw and rearrange the data displayed to the user, and handle user-based interaction between the mouse and the keyboard. CSS provides a consistent look for applications and provides a powerful shortcut to programmatically manipulate the DOM. The XMLHttpRequest object (or similar mechanism) is used for asynchronous communication with the server, submitting the user's request when the user is working, and obtaining the latest data. Figure 2-1 shows how these technologies fit in Ajax.
Figure 2-1 Four main components of Ajax: JavaScript defines business rules and program flows. The application uses Xmlhttp-request objects (or similar mechanisms) to get data from the server later, changing the appearance of the interface through DOM and CSS