Exercise 3: Javascript

sp.772
February 2002

Introduction

In this exercise, you will create a polished webpage about movies. The webpage will provide descriptions of movies as well as a form for purchasing the movies. Using the information learned from the lectures this morning, you will format the text of the webpage, add tables, forms, images and links.

The exercise is separated into six steps. At the end of each step, your webpage should look like the printouts in this handout. If you need help at any time, please ask us!


Step 1: Download Files to Disk

Place these files in your home directory at ~/www/sp.772/ps3
Note: If your directory is currently named sp772, 772 or some other variation please change it to be sp.772.


Step 2: Read the javascript

The goal of this exercise to add functionality to the "BUY!" button. In the finished exercise when the user click on "BUY!" an alert statement should pop-up with the total he owes. Please make sure you understand the code that is already written.

Step 3: Add your own javascript

The function calculateTotal had been declared but doesn't do anything yet. You must fill it in. The function is intended to take an array as input and return the sum of all the values in the array. See the comments in the code for more details.