Before we go into a lot of details on the object orientation of JavaScript, first look at some differences in the core components and functionality between server-side and client-side JavaScript. Both have objects that are specific to their runtime environment, so object initialization and creation occur at different times. Because of this characteristic, you will look at the language in two parts: client-side and server-side.
Client-side JavaScript is, at its lowest level, several core objects that are created when a page is loaded in the browser. In addition to these core objects, there are also derived objects that are created when certain tags are included on a page. These derived objects inherit some of the various characteristics of their parent object and also allow scripting access to the HTML tag's properties.
Understanding the hierarchy of the JavaScript objects is a very important item if you plan on doing any in-depth programming. You will get a better understanding of how parent and child objects interact as well as how they are referenced. To help with this understanding Figure below gives a graphical reprsentation of the basic client-side JavaScript Hierarchy.

As depicted in this diagram, all client-side objects are derived from either the window or navigator objects. Considering that this is an object based language, this structure makes complete sense. All objects on a given page are constructed within the browser's window, hence all bjects that JavaScript can create are descendants of the Window object. By using the Window object, a programmer is allowed to access the various frames, documents, layers, and forms on a page, as well as many other objects and properties.
The navigator object pertains to elements that are "part" of the browser itself. This specifically refers to the plug-ins installed and the MIME (Multipart Internet Mail Extension) types with which the browser is associated. Using the navigator object allows checking of the browser version, determining the plug-ins installed, and what programs are associated with the various MIME types registered on the system. There is also the ability to access other properties of the browser.
Like its client-side, server-side JavaScript has several core objects from which all other objects are derived. The root objects are the DbPool and database objects from which you can create connections to a database, as well as access cursors, stored procedures, and the result sets you generate. Figure below shows the specific server-side object hierarchy.
NOTE
Both of the server-side and client-side JavaScript languages are based on objects. Programmers familiar with Java will find this very similar to the Java language. There are not as many objects/classes in the JavaScript language, but the structure and manner in which you access them are similar.
Because of this object hierarchy, accessing the various objects and elements on a page is done by using the hierarchy itself. If you wanted to access a specific text field in a form on a page, you would do so using the following syntax:
window.document.formName.textboxName.value
TIP
With JavaScript, programers have the ability to create their own objects or extend the core ones defined by the language. The explanation of how to create your own objects-and some examples-is covered in the section on functions, in "Details of the Language." If you want to learn more about extending the functionality of the existing objects, look up objects with the prototype property in the reference section of this site.
Because JavaScript is object based, it automatically provides many advantages to using a modular approach to your programming. By creating your own objects and methods, you are able to better maintain the code with which you are working. You will be creating code that can be reused in other programs, locations, and instances. Why write virtually the same code twice (or many times), when you can create it once and pass the characteristics that differentiate it from other, similar objects?