Exercise : Petit (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 Petit

All required files are on Webster http://webster.cs.washington.edu/cse154/sections/9/, or you can download them as section8.zip. Breeds are located in the subdirectory breeds/ relative to the previous URL.

Exercise Petit

Exercise Solution

You can view the solution javascript here.