Lab 1: HTML and Javascript (JS)
CS 445 Computer Graphics, Fall 2017


Due Date: The beginning of lab, Wednesday Sept 6

Goals

Note, this is not a course in HTML or JS. We focus here primarily on some of the language constructs you will need in the later labs. However, you are encouraged to dig into the languages as much as you can. Many references are available in books and online.

There are many libraries and tools available for creating webpages with HTML/Javascript and WebGL. These can be very useful down the road but, in this course, we will not be using any of these because they hide a lot of what is going on especially in regard to webGL.

Be careful: JS and Java can look deceptively similar but are, in fact, very different languages. A few differences are described here. JS arrays, functions, and objects can be quite different than what you are used to in Java so please carefully read up on these topics.

Javascript and Browser Support

To learn more about JS and browser compatability, check out:

Resources HTML

As already mentioned, you do not have to be an expert in every aspect of HTML. You do need to know how to create a bare bones web page and how to use the HTML5 canvas and how to handle mouse and keyboard events.

Resources Javascipt

It is important that you get a good book on JS5. There is a lot you can find online but it can be difficult to learn about some of the more subtle issues especially about arrays, objects, event handlers, the DOM, and the communication between HTML and JS. Any advanced reference should work. In this course, the code you will be given is based on Javascript 5, also known as ECMAScript 5 or JS5. If you prefer to use JS6, please do but be warned that the lab code you will be given will be based on JS5.

Netbeans IDE

It is recommended that you use Netbeans to develop your HTML and JS code. The labs and demos for this course have been developed as Netbeans projects running in the Chrome browser.

There are a few things you need to install to get everything running:

Lab Instructions

You are to work with a partner which will be randomly assigned to you. They only part that will be collected is the item "Writing your own class". Feel free to do the other items individually or together.

If you are already familiar with HTML and/or JS, then try something more advanced than below, specifically, try to implement something you don't already know.

To Hand In

Demonstrate your program in lab on the due date no later than the end of lab. One partner should submit to WISE the html and js code for the above "Writing your own class". Add standard JS comments and also comments containing the name of both partners at the top of all files. In WISE, go to the tab for CS-445 01 17/FA, select the Assignments link on left, and then select Lab 1: HTML and Javascript (JS).

Remember: Assignments are due by the end of lab on the due date. Assignments turned in after this are considered late.