Exercise : Pet-It (by Stefanie Hatcher)

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)

expected output

Exercise : Pet-It

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.

Exercise : Pet-It

Exercise Solution

You can view the solution javascript here.