HTML and CSS Reference
In-Depth Information
Here's the full source code for the page:
<!DOCTYPE html>
<title> Learn More About South America </title>
<script src=”jquery-1.4.2.min.js” type=”text/javascript” charset=”utf-
<script type=”text/javascript” charset=”utf-8”>
$(function () {
$(“p.countryOption a”).click(function (event) {
<style type=”text/css” media=”screen”>
#country { border: 1px solid black; padding: 15px; }
p.question { font-size: 200%; }
<p class=”question”>
Which country would you like to know more about?
<div id=”country”> Foo </div>
<p class=”countryOption”><a href=”countries.html #uruguay”> Uruguay </a></p>
<p class=”countryOption”><a href=”countries.html #paraguay”> Paraguay </a></p>
To read about other AJAX-related methods offered by jQuery, take a look at the jQuery
API documentation. Most of the other jQuery methods are more suitable to application
development, but they essentially work in a similar fashion to the load() method that
you saw here.
Search WWH ::

Custom Search