|
|
|
|
|
|
|
|
|
|
|
|
|
|
JAVA SCRIPT
Object-oriented programming - especially the JavaScript version of it - isn't so hard to understand. The main idea is that information is organized in terms of objects. JavaScript is wonderful because it comes with a built-in library of objects. For example, a window is an object. Whenever I refer to one of the default JavaScript library objects, I will capitalize it (Window). Specific instances (a particular window) will be lowercase. Objects have properties that describe them. Some of the properties of a Window object are its name, the words in its status bar, the URL of the document inside the window, and the window's document itself, which includes the words, images, and hyperlinks inside the window. In JavaScript, you are given a default Window object called, of all things, window. Here's how you access a property of the default Window:
var the_status = window.status; This says: "Find the status property of the Window object called window, and load it into the variable the_status." The status property of the Window object contains the words that appear in the status bar. In addition to reading what those words are, you can also set those words. The way to set an object's property is this:
window.status = "I'm monkeying around!";
|
|
|||||
|
|
|||||||
|
|
|||||||
|
|
|
|