Chapter 12. Executable Content

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.

Applets and Objects

Applets represent a shift in the basic model of web communications. In most other web applications, servers perform most of the computational work, client browsers ...

Get HTML & XHTML: The Definitive Guide, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.