Learning HTML 3.2 by Examples, section 5 Descriptions of HTML 3.2 tags:

SCRIPT - client-side scripting languages (Not in HTML 2.0!)

Purpose

Reserved for future use with scripting languages.

Typical rendering

Browsers should hide the contents of SCRIPT elements. However, if the browser supports scripting, the script may affect the rendering of the document in many ways.

Basic syntax

<SCRIPT>script statements</SCRIPT>

Possible attributes

None according to HTML 3.2. In HTML 4.0, the SCRIPT element is defined so that it has an obligatory TYPE attribute and some optional attributes. (In some drafts and implementations, the attribute LANGUAGE has been used, but it has been deprecated in favor of the TYPE attribute.)

Allowed context

The head section and any text container. (The text part of the HTML 3.2 Reference Specification mentions only the head section as a place where SCRIPT element may occur, but the formal syntax (DTD) allows it in the BODY part as well, classifying SCRIPT as a text element. The latter is obviously the intent.)

Contents

Script statements. The syntax and semantics is to be defined separately.

Technically, these elements are defined with CDATA as the content type. As a result they may contain only SGML characters. All markup characters or delimiters are ignored and passed as data to the application, except for the character pair </ followed immediately by a letter (a - z, A - Z), This means that the end tag of the element (or of an element in which it is nested) is recognized. (Scripts may need to contain e.g. HTML end tags as data. Different scripting languages provide different methods for coping with this.)

Examples

Since there is no semantics defined for the SCRIPT element in HTML 3.2, no meaningful example can be given.

Notes

The SCRIPT element was introduced into HTML 3.2 just a place holder for the introduction of support for scripting languages in future versions of HTML, such as HTML 4.0.



Date of last update: 2010-12-16.
This page belongs to the free information site IT and communication, section Web authoring and surfing, by Jukka "Yucca" Korpela.