Today's lecture looked at a couple of web sites which do interesting things in JavaScript. We went through the source code in detail to see what techniques the authors used, and to critique the programming.
The first page we looked at was an implementation of the Towers of Hanoi game by Polish programmer R.J.Zylla. The version we looked at is available at http://chemeng.p.lodz.pl/zylla/games/hanoi7e.html. Mr. Zylla uses many ingenious techniques to simplify his coding and make the code more readily cross-browser compatible.
The second page we looked at was a script that makes a trail of balls follow your cursor. It is located at http://www.dynamicdrive.com/dynamicindex13/trailer.htm. This script works well most of the time, but it was interesting to note how hard the script is to read due to inconsistent style, lack of indentation, no documentation, and poor variable names.