An Abbreviated Introduction to JavaScript


Advanced Introductory Assignment: A MadLibs CGI Script

Purpose: The goal of this assignment is to get you accustomed to working with JavaScript in your pages and to learn how to write CGI scripts in JavaScript.

Queries

As you know from your earlier work with forms, you can use forms to query CGI scripts. If you use the get method, your browser appends a question mark and a string of name/value pairs. In JavaScript, you can gain access to that string with location.search.

For more information, you can read some notes or play with an example.

Exercise

Write a form and JavaScript-based CGI script that gather some information from the user and then play Mad Libs. If you've never played Mad Libs, a typical game of Mad Libs asks for a variety of types of words (e.g., names, verbs, nouns) and then builds a story from those words.

Alternate

If you'd prefer, you may instead want to do the basic introductory assignment or the moderate introductory assignment.


Source text written by Samuel A. Rebelsky.

This page may be found at http://www.math.grin.edu/~rebelsky/Tutorials/JavaScript/Spring1999/Assignments/advanced1.html

Source text last modified Mon Apr 12 10:14:34 1999.

This page generated on Mon Apr 12 12:46:26 1999 by SiteWeaver. Validate this page's HTML.