<<Back to Week 3 | 1 | 2 | 3 | 4

What is it

Javascript is a client-side scripting language. This description has two modifiers, "client-side," and "scripting." The term "scripting" means that the language is not stored as executable machine code, but rather is stored as plain text that the computer converts to machine code when needed. This allows the same script to work on computer systems running different operating systems.

The term "client-side" means that the user's computer does this translation instead of the web server. This differs from a server-side scripting language such as PHP that we will look at later in the semester. In terms of working with javascript, this distinction has very little impact. Server-side scripting languages, on the other hand require a different approach--they must be run off the server--and this distinction will become much more important when we get to that.

Client-side scripting has no "lag time" associated with sending the command to the server over the internet, hence is more responsive. But in order to work, the user's computer must have the ability to understand the script, that is, javascript must be installed on the users machine and enabled in the browser (the user can turn javascript off). While this does not create a problem with the vast majority of browsers running today, it is good practice to include "noscript" messages in web pages that use javascript in order to warn the user. These messages display if the browser detects that javascript is not available.

HTML is for the most part a very static language. Once an HTML page is rendered to the screen, there is no way to change a portion of it independent of reloading the entire page. Javascript changes this. It allows a dynamic interaction with the Document Object Model (DOM) of the page. What this means is that HTML only knows how to display a static page whereas JavaScript allows this static page to change based upon interaction with the user.

Javascript is an extensively featured language, and a full review of it is beyond the scope of this class. We will take a brief look at the structure of javascript then review three examples of where Javascript is commonly used:

Javascript is also a component of AJAX (Asynchronous Javascript and XML). AJAX is not a language of its own, but rather a combination of existing technologies in a new conceptual model. The use of AJAX is becoming widespread. It is used extensively by sites such as gmail that dynamically load and change the display of different areas of the screen. We will not be looking at AJAX specifically in this class, but just be aware that it is based upon the same technologies we are learning, and that if you need AJAX functionality in your page, it is within your reach.

<<Back to Week 3 | 1 | 2 | 3 | 4