Module 4: JavaScript

The fourth and final module of CIS 2336 departs from the server-side technologies explored in the second and third modules, returning the focus of the course to client-side technologies. An introductory look into JavaScript, an object-oriented scripting language, reveals the possibilities of using client-side scripting with HTML pages to allow manipulation of web page behavior and also further interactivity with end-users.

Module Overview

In the previous two modules, I learned how to create dynamic pages by utilizing server-side technologies like PHP and MySQL. In the fourth and final module, I learned how to further allow for web page interactivity but with client-side scripting using JavaScript. JavaScript may be readily incorporated into any HTML page, and it is responsible for the behavior of pages. It can be used in conjunction with server-side technologies, if appropriate; together with PHP and MySQL, JavaScript can maximize the dynamic potential of a website.

Unlike in the previous modules, the materials of this module were explored through only two assignments: Codecademy and W3Schools. The W3Schools assignment was predictably an effective reinforcement of lessons already learned and served as an excellent reference. The Codecademy assignment, on the other hand, shouldered the burden of both (1) showing me the fundamentals of JavaScript and (2) showing me practical applications using JavaScript. The rock-paper-scissors game, in particular, demonstrates the high levels of interactivity that end-users can potentially have with a page, which is why I have chosen it as the assignment to represent Module 4 of my learning portfolio.

Although only two assignments comprised this module, the material never seemed overwhelming to me because a substantial portion of it could be considered review. Because the syntax of JavaScript is very similar to that of PHP, I felt very much at home and was completely comfortable learning the small syntactic differences that distinguish the two. Also, because I made a conscious effort to properly learn programming in a previous course, I was able to quickly adapt. As Professor Crowley once mentioned in class, there is a difference between learning programming and learning a specific language, and I am thankful I did the former.

Codecademy – Rock-Paper-Scissors Game

I created a rock-paper-scissors game that pits a user against the computer. The user is able to type in the hand he wishes to play, which is then evaluated against a randomly generated hand by the computer. Although simple, the example shows the possibilities of using JavaScript to boost web page interactivity.

Below is a screenshot of the game (click thumbnail to view full size image).


Codecademy RPS