One of the most useful web technologies is the ability to deliver applications directly to the browser. These typically small programs perform simple tasks on the client computer, from responding to user mouse or keyboard actions to spicing up your web page displays with multimedia-enabling software.
You can embed scripts in your documents using a language known as JavaScript. Or you can load and execute small, Java-based, platform-independent applications known as applets. During execution, these programs may generate dynamic content, interact with the user, validate form data, or even create windows and run entire applications independent of your pages. The possibilities are endless, and they go far beyond the simple document model originally envisioned for HTML.
In this chapter, we show you, with simple examples, how to include two kinds of executable content ? scripts and applets ? in your documents. We won't, however, teach you how to write and debug executable content. This is a book about HTML and XTHML, after all. Rather, get an expert opinion: turn to any of the many excellent texts from O'Reilly, including JavaScript: The Definitive Guide, by David Flanagan, Java in a Nutshell, also by David Flanagan, and Learning Java, by Pat Niemeyer and Jonathan Knudsen.