In earlier lessons, you’ve learned:
- How to use dialog boxes and variables to store and utilize user input
- How to make your Web pages react to users’ actions using link events
- How to do a basic image swap
So far I’ve explained how to do many things, but I haven’t described why they work. In the last lesson, for instance, I showed you that
window.document.monkey_image.src = "happy_monkey.gif" will swap
happy_monkey.gif into an image named
monkey_image . But what is that
window.document stuff? And where does the
.src come from? Similarly, you’ve seen
document.writeln("monkey") . But why is it
document.writeln and not just
Let’s start with loops.
Now that you’ve mastered the basics of computer programming, it’s time to refocus on the Document Object Model (DOM). We’ve already seen that the DOM hierarchy starts with a Window object. Inside each Window object is a Document object. We’ll be spending this lesson going through the Document object and seeing how it can be used to get all kinds of information from your users and to dynamically present new information.
Next, his Thauness gives lessons on image mapping and preloading images, with practical applications such as setting up an employee database and creating a virtual pet!
Get started: Lesson 1