Web Programming Step by Step
Discussion Section 7: Pet-It
Ajax

section idea/code 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 a skeleton petit.html and petit.js. Add the JavaScript event-handling and Ajax code. Click the following image to run our sample solution, written by Stefanie Hatcher: (solution JS code petit.js)

expected output

All required files are on Webster in the directory http://webster.cs.washington.edu/sections/09sp/section7/, or you can download them as section7.zip.

References: Ajax.Request, Ajax.Updater, Ajax options, JSLint

Valid XHTML 1.1 Valid CSS!