Contents
[Contents] [Tutorial]
[Object
Hierrachy] [Language]
[Expressions]
[Statements]
Introduction To Object Speak
JavaScript has broken down the components of a web page into objects.
An object in simple computing terms can best be described as follows:
- An object has properties: a colour is a property.
- An object has methods: a method allows an object to be
told to do something, for example, open up a window, or display
a yes/no dialog box.
- An object has events: it allows the object to tell the
outside world that it has something to say about itself, should
anybody be interested. For example a checkbox would "fire
an event" were it to be checked or unchecked.
Notes:
- objects can contain other objects. For example a color can be
considered as an object, composed of Red Green and Blue properties.
- Methods are usually used to do perform some action. Some methods
"return" a value or object (as explained in the discussion
of JavaScript variables).
- Methods and events pass parameters. For example the window.open()
method has parameters to specify what the window should look like
(width, height ...).
There's a lot more to object oriented programming, but we'll skip
the part where confusion usually sets in, it's easier to pick things
up when they are needed.
[Contents] [Tutorial]
[Object
Hierrachy] [Language]
[Expressions]
[Statements]
Object Hierarchy
The "object hierarchy" described here is extremely important.
JavaScript is a programming language, the object hierarchy specifies
all the objects JavaScript can manipulate. The objects described
below are in a sense JavaScript's view of HTML pages.
- Parent, Frames, Self, Top
- Document
- Location
- History
- Forms
- Elements (text fields, textarea, checkbox, password, radio,
select, button, submit, reset)
- Links
- Anchors
There are many more objects to peruse at your convenience. A good
reference site is none other than Netscape's own reference
manual .
[Contents] [Tutorial]
[Object
Hierrachy] [Language]
[Expressions]
[Statements]
|