Winter 2007

Objectives

Upon completion of this exercise, you should

  • Understand the role of the document object
  • Be able to utilize the properties and methods of the document object to affect the overall look of the document.
  • Recognize members of the document object that are particular to different browsers.
  • Feel comfortable opening and closing new documents using methods of the document object.

Exercise Instructions

  1. Use three different "browser particular" properties of the document object within a single script. Pay special attention to the browser compatabilities and test your script in both Internet Explorer and a Mozilla browser (firefox, opera) See if you can create a script that works
  2. Using the document properties, fgColor, bgColor, alinkColor, linkColor, vlinkColor, create a customizable page with five text boxes that collect user input for each of these properties and assign them when the form is submitted. Be sure to include several links and other text on the page to view your result.
  3. Combine your knowledge of text boxes and the open() and close() methods to revise your "Mad Libs" page (from exercise 3) with the user entering their own variable values. Display the resulting story in a new document. View the source code of the new document once it opens with your story in it.

Report

Upload the following to your website (or Vault account):

  • The Browser quirks page
  • The Customizable page
  • The Mad Libs (revised) page