[an error occurred while processing this directive] File: index.shtml Creator: George Ferguson Created: Mon Sep 17 12:39:03 2012 Time-stamp: [an error occurred while processing this directive] File: templates/doc-start.shtml Creator: George Ferguson Created: Tue Dec 6 12:31:29 2011 Time-stamp: [an error occurred while processing this directive] File: site-settings.shtml Creator: George Ferguson Created: Tue Dec 6 13:49:49 2011 Time-stamp: Site (or subsite)-wide settings. [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] File: head.shtml Creator: George Ferguson Created: Tue Dec 6 12:34:15 2011 Time-stamp: SSI variables for this template: head_title if given, else ``sitename | title'' [an error occurred while processing this directive] File: head-title.shtml Creator: George Ferguson Created: Tue Dec 6 14:29:52 2011 Time-stamp: SSI variables for this template: head_title: complete content of title element if given site_title trailing part of title (if given) section_title middle part of title (if given) page_title leading part of title (if given) title title shown on page, also used as leading part of title (if given) [an error occurred while processing this directive] (none) [an error occurred while processing this directive] File: head-meta.shtml Creator: George Ferguson Created: Tue Dec 6 14:29:18 2011 Time-stamp: SSI variables for this template: meta_description meta_keywords meta_generator [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] File: head-stylesheets.shtml Creator: George Ferguson Created: Tue Dec 6 14:22:58 2011 Time-stamp: SSI variables for this template: site_stylesheet, page_stylesheet stylesheet0, stylesheet1, ...: URL for stylesheets [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] File: head-scripts.shtml Creator: George Ferguson Created: Tue Dec 6 14:23:19 2011 Time-stamp: SSI variables for this template: site_script, page_script script0, script1, ...: URLs of javascript scripts [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] File: body-start.shtml Creator: George Ferguson Created: Tue Dec 6 13:20:46 2011 Time-stamp: SSI variables for this template: body_class page_class page_id [an error occurred while processing this directive] [an error occurred while processing this directive] File: body-header.shtml Creator: George Ferguson Created: Tue Dec 6 13:46:12 2011 Time-stamp: Content above banner, if any. [an error occurred while processing this directive] File: body-banner.shtml Creator: George Ferguson Created: Tue Dec 6 13:27:12 2011 Time-stamp: Duplicate URCS Drupal banner. hajim urcs
Computer Science @ Rochester
Computer Science Department : Hajim School of Engineering & Applied Sciences Skip to main content [an error occurred while processing this directive] File: body-title.shtml Creator: George Ferguson Created: Tue Dec 6 14:34:49 2011 Time-stamp: SSI variables for this template: section_name First line of title on page (if any) title Title shown on page

[an error occurred while processing this directive] DMS102/CSC170D: Introduction to Web Development
Spring 2013
[an error occurred while processing this directive]
Assignment 3: Scripts and Variables

  1. [3 pts] Create a page that uses only a Javascript script element in the body of the document to create the following content:
    • A toplevel heading
    • A paragraph containing one short sentence of text
    • A list with two items in it
    Concentrate on making your scripts readable/understandable (as well as correct).
  2. [3 pts] Create a page that asks the user for their name and their favorite color and displays them in the body of the page.
  3. [3 pts] Extend your previous script so that the favorite color is displayed in that color. You may assume that the color is one of the predefined CSS color names.
  4. [3 pts] Create a page that asks a user first for their name, then for their favorite color, and then for their phone number and displays the results as a table in the page.

Things to think about

  • In developing your pages/scripts, be sure you understand the following:
    • Visiting the page in a real browser (Firefox recommended; Chrome or Safari usually also ok) to test its execution.
    • How to be notified of errors during your script's execution.
    • The basic development cycle for programming:
      1. Design
      2. Write the code
      3. Run the code (load the page)
      4. Works properly? You're done!
      5. Otherwise rewrite (go to 2) and/or redesign (go to 1)
      6. Repeat until done
    The more you understand this now, the easier life will be as we start developing more complicated programs. Use your lab times effectively, especially if you are new to programming.
  • When writing a script that generates HTML (for example, with document.write), first think what the HTML should look like. That is, what would it be if you were writing a static page. Then get your script to produce that HTML using document.write. And then use variables (and perhaps also window.prompt) to get the dynamic parts into the HTML that you're adding to the document.
[an error occurred while processing this directive] File: doc-finish.shtml Creator: George Ferguson Created: Tue Dec 6 13:46:48 2011 Time-stamp: [an error occurred while processing this directive] File: body-footer.shtml Creator: George Ferguson Created: Tue Dec 6 14:43:56 2011 Time-stamp: Content at bottom of page, if any.

Last update: Thursday, 07-Feb-2013 09:45:46 EST

[an error occurred while processing this directive] File: body-finish.shtml Creator: George Ferguson Created: Tue Dec 6 13:47:36 2011 Time-stamp: [an error occurred while processing this directive]