Sams Teach Yourself HTML, CSS & JavaScript Web Publishing in One Hour a Day

(singke) #1
ptg16476052

AJAX and jQuery 523

18


as Corazon de America, or the Heart of America.


As of 2009 the population was estimated at 6.3 million. The capital and
largest city is Asuncion. The official languages are Spanish and Guarani, both
being widely spoken in the country. Most of the population are mestizos.





For a real application, instead of this simple page, you’d have a more robust service that
could return lots of information about every country in South America on demand. This
sample page illustrates the concept without requiring knowledge of server-side program-
ming.


Now that the raw information is in place to be used on the page, I’ll explain how the page
works. When a link is clicked, the information is retrieved from countries.html and dis-
played on the initial page, as shown in Figure 18.17.


First, let’s look at the two links:


Uruguay


Paraguay


They almost look like regular links. The one difference is that I’ve included a space
between the filename and the anchor in the URL. That’s because it’s not really an anchor;
it’s the ID of a

on the countries.html page.


FIGURE 18.17
The information
about Uruguay was
loaded from an
external source.

Free download pdf