17.1 Specifying the scripting language

The contentScriptType
attribute on the
<svg>
element specifies the default scripting language for all scripts
in the given document.

.
contentScriptType = "<contentType>"

Identifies the default scripting language for all scripts in the given document.
The term contentType has the same meaning
and usage as the term "content type" has in
the HTML 4.0 Specification [HTML40].

In the absense of a contentScriptType attribute,
the default can be set by a "Content-Script-Type" HTTP header:

Content-Script-Type: <contentType>

User agents should determine the default scripting language for an SVG document
according to the following steps (highest to lowest priority):

If a contentType attribute is provided
on the <svg> element, then
the value of that attribute determines the default scripting language.

Otherwise, if any HTTP headers specify the "Content-Script-Type", the last
one in the character stream determines the default scripting language.

Documents that do not specify a default scripting language
should set the default scripting lanuage to "text/ecmascript".

17.2 The <script> element

A <script> element can appear as a subelement to any <defs> element.
A <script> element is equivalent to the <script> element in HTML
and thus is the place for scripts (e.g., ECMAScript). Any functions defined
within any <script> element have a
"global" scope across the entire current SVG document.

The following is an example of defining an ECMAScript function and defining
an event handler that invokes that function:

Identifies the scripting language for the given
<script> element.
The term contentType has the same meaning
and usage as the term "content type" has in
the HTML 4.0 Specification [HTML40].
If this attribute is not provided, the default scripting language
is set as described under
Specifying the default scripting language.