IN THIS CHAPTER
Client-Side versus Server-Side Scripting
Setting the Default Scripting Language
Including a Script
Calling an External Script
Triggering Scripts with Events
Hiding Scripts from Older Browsers
Standard HTML was designed to provide static, text-only documents. No innate intelligence is built into plain HTML, but it is desired, especially in more complex documents or documents designed to be interactive. Enter scripts—svelte programming languages designed to accomplish simple tasks while adhering to the basic premise of the Web, easily deployable content that can play nicely with plain-text HTML.
This chapter covers scripting basics and then provides the details of how to use client-side scripting in your documents.
There are two basic varieties of scripting, client-side and server-side. As their names imply, the main difference is where the scripts are actually executed.
Client-side scripts are run by the client software—that is, the user agent. As such, they impose no additional load on the server, but the client must support the scripting language being used.
For security reasons, client-side scripts generally cannot read or write to the server or client ...