General Information Page for JavaScript

Purpose:

There are three purposes of this page:
give a brief overview of what JavaScript is and isn't, what it can and can't do, and in the process clear up misinformation that may exist about JavaScript.


Section 1:

What JavaScript is(and what it isn't)

  • First, Javascript and Java are not the same things. The difference between the two is that Java is a compiled language, while JavaScript is not. What this means at the most basic level is that Java requires additional software and a compiler, whereas the JavaScript programming language is included as part of your internet browser.
  • What this means is that Javascript is client-side, which means that it is connected to (a part of) your browser (and therefore, the version of JavaScript changes from browser version to browser version). This means that whatever browser you use (Navigator, Communicator, Explorer), these products already have the capabilities to perform JavaScript events. Since JavaScript is part of your browser and the specifications and abilities of JavaScript change from version to version, your particular version of browser may not support all features (or any features) of JavaScript. However, most people use Navigator or Explorer 3.0 version or greater, so much of JavaScript is available to you. If you find that you have problems implementing some JavaScript, the problem may stem from your browser version.

    Section 2:

    What can JavaScript do?

    Javascript can perform events like mouseovers, alert boxes, etc. What JavaScript does is perform events called by event handlers, which manipulate objects that exist in the document object model. To illustrate this concretely, here is a textual example. For example, let's say that we have a web page that has a number of images that are referenced by < img src="imagenamehere"> calls. Now, when these objects exist in the specified directory, they are accessible through that object's document model. Additionally, each object has properties (for images they are width, height, etc.). This document object model is an array that can be referenced by a number. So to get to the properties of the third image in the page, we would make a call similar to this: document.images[name or number].src(or width, height, etc.). Each part in this call is a part of how to access the image object model. So, under the document object is the image object, and if there are four images on the page, they are included in this model by name or number, in the order that they are on the page.

    Section 3:

    An Overview of Object Oriented Programming (OOP)

    Even though JavaScript is one of the easier programming languages to obtain and learn, it still requires a bit of knowledge about programming and the idea of OOP (or more commonly, Object Oriented Programming). There are two ways to "speak" with a computer (even though it only understands one type in the strict sense). A computer understands byte or bit language, which at the basic level is a series of ones and zeros. And you can program in a series of ones and zeros by hand, but this becomes very tedious very quickly. So the answer to this (and consequently the other way to communicate with a computer) is through an interface that has been programmed to deal with the ones and zeros behind the scenes, and this is object oriented programming. It provides an interface so that you (the programmer) can think of the objects that the a relation of ones and zeros represent rather than the byte language itself. Object oriented programming works on this principal of abstraction. And JavaScript, along with C++ and others, operate on this principal. So using the example in the section above in this sense, the document references the html page itself, the image object references the array that hold the changeable properties of the images, and the extension to the image (followed by a dot) refers to the properties of the particular image, allowing you to find and manipulate qualities of anything that is on the web page.
  • Home
    Talk to the authors! Credits