Today we will write a page "Pet-It" that shows information about breeds of cats and dogs using Ajax. The HTML and CSS are already written; start from them:
Add the JavaScript event-handling and Ajax code. Click the following image to run
our sample solution:
(solution JS code petit.js
)
All required files are on Webster
http://webster.cs.washington.edu/cse154/sections/ajax/
,
or you can download them as pet-it.zip
.
Breeds are located in the subdirectory breeds/
relative to the previous URL.
dogs.txt
and cats.txt
.
breeds/chow_chow.html
and
breeds/chow_chow.jpg
.
selected
). If the user reaches the last breed and clicks Next, wrap around to the start.
You can view the solution javascript here.