CogSci 3 - JavaScript Assignment - Part 2
Due: Saturday November 21st, 11:59 p.m. 2009

Goals

Class lectures

Part 2: cg3fzz-java-2.html

Before we go any further

We are going to give you different snippets of Javascript code to enter. You can't actually test any of it until all of the Javascript has been entered. It's entirely possible to enter some syntactically incorrect Javascript early on and not realize that it's in error. The syntax error(s) will keep your page from working properly when you finally do test it at the end. And then you will have put in so much stuff (code) it will be hard to know where to look for the error.

So we suggest that you use the browser Firefox. In the Firefox Tools menu, there is an "Error Console". Select that and it will show you any Javascript syntax errors! (Actually it will show you CSS syntax errors too. smile)

Declare an array called mySlides

Load all of the images into the mySlides array -- and create myCaptions array.

Global Variables - slidenumber and totalslides

Writing the function - showSlide(direction)

Add JavaScript comments to the XHTML comments when finishing the script!!

Modify the form buttons (previous and next) --- so that when you click on them, they call the JavaScript function.


Note: in the figure above, the last <input element needs to have a closing />, of course.


Copyright 2006, Mary E.T. Boyle
Modified November 2007 mrw