University of Washington, CSE 190 M, Spring 2007
Lab 7: Google Search API (Thursday, May 10th, 2007)

This lab's purpose is to give you some practice using the Google Search API introduced in lecture. You will implement a new Google feature (!) which allows you to search for food types in different locations and save your favorite results. You will be using the GlocalSearch object. We're providing you with HTML and CSS files to get you started.

Google Food (beta)

We would like you to develop this lab in the following steps. Complete as much as you can in the time provided.

  1. Write Javascript code that grabs the text from the "Search for:" box and uses it as a query for a Google Local search. Inject the search results in the div whose ID is resultDiv. Ignore location information for now.
  2. Modify your code so that it works for multiple searches. When a new search is made, the results from the previous search should be replaced.
  3. Set the center point of the search to the value in the "Set location:" text box.
  4. Display a message listing the search query and center point in the resultTitle element, such as the "Looking for ethiopian in Seattle" message below.
  5. Add an "Add to favorites" button after each entry. When a user clicks this, the entry should be added to the div with ID saved.

This is what your page might look like after a few elements have been saved (between, but not including, the thick black lines):


What the page might look like

When you're satisfied with your page, you may optionally wish to turn it in so that we can see it, or upload it to your UW web space. You may need to ZIP your files for them to submit successfully.

Valid XHTML 1.0 Strict Valid CSS!