CST2613 JavaScript
Instructional Guide


How to turn in your assignments:

Put copies of all your labs on a floppy disk or a CD-ROM and turn it in to your instructor.    You must label the media with your name and course number.

All labs must be submitted together at the end of the semester.


Files & Utilities

Note:  Most of the programming examples in the textbook can be found with the online companion to the book.  See the link Files & Utilities above.  Many of these programs will require you to have an small web site to effectively demonstrate your JavaScripts.  A suggestion would be to use HTML pages that you wrote for CST / MMDT1021 as a base.

Lab 4

Read chapters 1 - 3 in the book.  Most of the material in these chapters is background material as to what JavaScript is and what JavaScript can do.  (Chapters 1 & 2 in 4th edition)

Read chapters 4 & 5.  Chapters 4 & 5 describes image rollovers and other image effects.  (Chapter 3 in 4th edition)

Do:  Write a JavaScript program that  that performs an image rollover.


Lab 7

Read chapter 6 in the book.  This chapter is related to frames.  Frames are generally not as widely used as they once were, so there will be no JavaScript assignment for this chapter.  Yet sometimes frames are the only way to present information, so reading the chapter is necessary.  (Chapter 4 in 4th edition)

Read chapter 7.  Chapter 7 describes how to open pop up windows and manipulate those popup windows.  (Chapter 5 in 4th edition)

Do:  Write a JavaScript program creates a popup window of a set size of your choosing.


Lab 9

Read chapters 8 & 9 in the book.  These chapters are about form validation.  Submission of a form requires a working cgi program on the server to accept your input from the form and to process it.  (Chapters 6 & 7 in 4th edition)

Do:  Write a JavaScript program that validates your input on a form.  Examples might be that the numbers entered into a text box have to be between the values of 1 and 999.  Or that a name entered has at least 2 characters in it but not more than 20 characters.  In this exercise you are only validating the data.  The form will not actually be processed.  However for those of you that took C# / C++, you created a form that accepted 4 numbers and processed it using a cgi C++ exe program on the server (the Rational program).  That would be an excellent form to validate the input for non zero numerators and denominators and numbers that are too large in magnitude.


Lab 11

Read chapters 10 & 11 in the book.  Chapter 8 is about making dynamic pages and chapter 9 is about event handling. (Chapters 8 & 9 in the 4th edition)

Do:  Write a JavaScript program that has an input box with your birth date (MMDDYYYY) in it.  Remember to validate your input.  Have an image of you (or a birthday cake or something similar) on the web page.  When clicking on the image, another small popup window should open and give the number of days to your next birthday.


Lab 12

Read chapter12 in the book.  Chapter 12 is about creating, reading, and writing cookies.  Cookies are used in most e-commerce web sites to track visitor data, such as visitor preferences, shopping cart contents, etc.  (Chapter 10 in the 4th edition)

Do:  Write a JavaScript program on a web page that collects some data about a user and creates and writes a cookie.  This data could be such things as birthday, address, favorite color, etc.  Create a second webpage that contains a JavaScript program that reads the cookie back and displays the information contained in the cookie.


Lab 14

Read chapters 13 & 14 in the book.  Chapter 13 is about controlling CSS.  Chapter 14 is about working with DHTML.  (Chapters 11 & 12 in 4th edition)

Do:  Write a JavaScript program on a web page that moves an image and some text across the screen.


Final Lab

Read the remaining chapters in the book.  Read closely the chapter that shows some debugging techniques.

Do:  Combine everything that you have learned into a small web site.  Take the work from the previous labs and combine it all together.

Put copies of all your labs on a floppy disk or a CD-ROM and turn it in to your instructor.    You must label the media with your name and course number.

All labs must be submitted together at the end of the semester.