Assignment 4
Arrays, Classes and Callback Functions
Due Saturday October 12 before 11:30pm

Overview

For this assignment, you will make use of the ChiEmpQuery class to access Chicago employee information. This class permits a simple search query to an online service. When the search results return to the browser, the class code calls your callback function with an array of results. Your callback function then displays the array contents on the page.

Chicago Public Officials Database

Using the Chicago City Salary page as a starting point, develop an interactive page that does the following given a search string:

  • A well formatted display of the matching records including name, title, department and salary.
  • An informative message if no records match.
  • Some user-specified options for displaying the records.

You do not need to edit the ChicagoEmployees.js file, but you are encouraged to read its comments to understand how to use it.

Not challenging enough? Consider the following:

  • A menu that controls which fields will be displayed
  • The search word matches on any field including the department and the job title. Allow the user to specify which field must be matched and only display matches for that field.
  • Extra challenge: read up on the sort method for arrays. Allow the user to choose the field by which the records will be sorted.

Submission

On D2L, submit a zip file of a folder with the following contents:

  • A readable document (pdf or txt) that summarizes your accomplishment.
  • html file
  • JS file
  • Any supplementary files for your web app

Grading

This assignment is worth 10 points. A rubric will be provided with the submission.