section idea/code by Stefanie Hatcher; revised by Marty Stepp
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 the following skeleton:
Add the JavaScript event-handling and Ajax code. Click the following image to run our sample solution, written by TA Stefanie Hatcher: (solution JS code petit.js
)
All required files are on Webster in the directory http://webster.cs.washington.edu/cse190m/sections/7/
, or you can download them as section7.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.
References:
Ajax.Request
,
Ajax.Updater
,
Ajax options, JSLint