--== Objects ==--
[ Previous Section | Home | Index | Test Your HTML | Related links | Next Section ]



Java Script is an object-oreinted language. Therefore it is important to understand what objects are and how they work. Objects allow you to organize information. Let's take a house for example. It has certain properties, such as style color, age, location, ... These properties describe the house. In Java Script, properties describe the object. In the case of the house, the house is the object and its' color is one of its' properties.

For our example lets say we have a red, two story house that is 16 years old.
The house is our object.
house.color= "red"
house.style= "two story"
house.age= "16 years old"
In Java Script the name of the object comes first, followed by the property you are referring to. For the color property house comes first because we are talking about the house object. The object and property are seperated by a period.

Java Script has a set of built-in objects. These objects provide information about the current webpage being viewed. Most of the built-in Objects are part of Navigator Object Hierarchy. The Navigator Object Hierarchy starts with a base object called the Window object. The Window object contains most of the properties for the Webpage, as you will see later.

Window
Location
History
Document
Forms
Anchors


Object Description
window Allows you to work with the navigator window and the page that is open
location Allows you to work with the URL.
history Allows you to find out where the user has been
document Allows you to do almost anything in the web page. Most heavily used obje ct.
Other built-in objects
string Allows you to manipulate text.
Math allows you to perform complex math functions like square root.
DateAllows programs to work with the current date or create instances for specific dates. It includes methods for calculating the differences between two dates and working with times.


As you can see Objects are the foundations of Java Script. They can be very confusing after a litle practice though they are not that bad. If after reading this section you are still confused try going to the reference page to find more help. Also if you have not quite gotten objects you can go ahead to the next section. You will probably catch on after another lesson or two.
[ Previous Section | Home | Index | Test Your HTML | Related links | Next Section ]