AJAX In Action [92]
5.4.2 Introducing the planet browser example
Before we dive in to the different data exchange mechanisms, let’s introduce a simple example, to serve as a hook on which to hang our arguments. The application will present a range of facts about the planets of our solar system. Our main screen shows an idealized view of the solar system, with an icon for each planet. On the server, we have recorded various facts about these planets, which can be brought up in pop-up windows by clicking on the planet’s icon (figure 5.6). We aren’t using the ObjectViewer from chapter 4 here, but we will get back to it later in this chapter.
The part of the puzzle that interests us now is delivering the data shown in the pop-up from the server to the browser. We’ll look at the format of data that the server sends us in each variation, but we won’t go into the details of generating that data, as we’ve already covered the principles in our discussion of MVC in chapter 3. Listing 5.1 shows the skeleton of our client-side application, around which we can explore the various content-delivery mechanisms.
Licensed to jonathan zheng 176 CHAPTER 5 The role of the server Figure 5.6 Screenshot of planetary info application, in which pop-up windows describing each planet can be brought up by clicking on the icons. Listing 5.1 popups.html "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> href="main.css"/> href="windows.css"/> href="planets.css"/> libraries Licensed to jonathan zheng The details: exchanging data 177®Online Book Reader



