Adding an “Automatic” Script

There are two kinds of scripts—those that are executed without the visitor having to do anything and those that react to something the visitor has done. The first group might be called “automatic scripts” and are executed by the browser when the page is loaded. You can have as many automatic scripts as you like on a page. They will run in the order they appear. (The second group, “triggered scripts”, is discussed on page 314.)

To add an automatic script:

1.
In your (X)HTML document, type <script.
2.
Type type="text/language-name", where language-name identifies the scripting language you’re using: javascript, vbscript, etc.
3.
Type language="script", where script is the name of the scripting language you’ll be using: ...

Get HTML, XHTML, & CSS, Sixth Edition: Visual QuickStart Guide 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.