Académique Documents
Professionnel Documents
Culture Documents
There are two types of scripts authors may attach to an HTML document:
Those that are executed one time when the document is loaded by the
user agent. Scripts that appear within a SCRIPT element are executed
when the document is loaded. For user agents that cannot or will not
handle scripts, authors may include alternate content via
the NOSCRIPT element.
Those that are executed every time a specific event occurs. These
scripts may be assigned to a number of elements via the intrinsic
event attributes.
The following sections discuss issues that concern user agents that support
scripting.
>
Attribute definitions
charset(character encodings)
The SCRIPT element places a script within a document. This element may
appear any number of times in the HEAD or BODY of an HTML document.
The script may be defined within the contents of the SCRIPT element or in an
external file. If the src attribute is not set, user agents must interpret the
contents of the element as the script. If the src has a URI value, user agents
must ignore the element's contents and retrieve the script via the URI. Note
that the charset attribute refers to the character encoding of the script
designated by the src attribute; it does not concern the content of
the SCRIPTelement.
Scripts are evaluated by script engines that must be known to a user agent.
Authors should specify the default scripting language for all scripts in a
document by including the following META declaration in the HEAD:
Content-Script-Type: type
User agents should determine the default scripting language for a document
according to the following steps (highest to lowest priority):
The type attribute must be specified for each SCRIPT element instance in a
document. The value of the type attribute for a SCRIPT element overrides the
default scripting language for that element.
"http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<SCRIPT type="text/vbscript"
src="http://someplace.com/progs/vbcalc">
</SCRIPT>
</HEAD>
<BODY>
</SCRIPT>
</BODY>
</HTML>
Note. Authors of HTML documents are advised that changes are likely to
occur in the realm of intrinsic events (e.g., how scripts are bound to events).
Research in this realm is carried on by members of the W3C Document
Object Model Working Group (see the W3C Web Site
at http://www.w3.org/ for more information).
Attribute definitions
For instance, authors may want to include press buttons in their documents
that do not submit a form but still communicate with a server when they are
activated.
The following examples show some possible control and user interface
behavior based on int