JavaScript has many objects, arranged in a hierarchy:
| HTML Element |
| Anchor |
| Document |
| Form |
| Image |
| Input |
| Button |
| Checkbox |
| FileUpload |
| Hidden |
| Password |
| Radio |
| Reset |
| Select |
| Submit |
| Text |
| TextArea |
| Link |
| Option |
JavaScript objects have properties which you can manipulate, such as window.status. You are given a default Window called window. For example, when you pass your mouse over the first button following, the window.status (which is displayed down on the toolbar) will change to "On", and when you mouse over the second button, it will change to "off". As well as status, the window object has a name, the URL of the document it contains, and the window's own document.
The relevant portion of the code for the ON button is :
< A HREF="#top" onMouseOver="window.status='On'; return true" >. It sets the status of the default window to "On" (so "On" is displayed on the taskbar). The return true" prevents the browser from looking at the contents of the anchor (A HREF="#top") and putting them in the taskbar instead.
JavaScript objects have methods which you can use, such as window.open() or window.alert(). Unlike properties, methods are always followed by parentheses. If the method takes any parameters, then these should be placed within the parentheses, for example window.alert("Hey You!"). Some other methods belonging to window are window.focus, which makes the window the top window, and window.blur(), which sends it to the back.
Clicking here will send this window to the back.
As window is the default top level object, it may be OK to omit the window. portion of the alert.
Back to top Home Serious Stuff
© 2002. Copyright Sue Nethercott.