SCRIPT

Description

It is used to specifies a script for the page that will be interpreted by a script engine.

Syntax

<SCRIPT
CLASS=classname
DEFER
EVENT=eventname
FOR=element
ID=value
LANGUAGE=JAVASCRIPT | JSCRIPT | VBSCRIPT | VBS
SRC=url
TITLE=text
TYPE=MIME-type
>

Parameter

Description

CLASS

Specifies the class of the tag being defined. This is used to associate a sub-classed style sheet with the tag.

DEFER

Indicates the script block contains only functions and no in-line script. Deferring the parsing of scripts until they are needed can improve performance by decreasing the time it takes to load a document.

EVENT

Specifies the event the script is being written for.

FOR

Specifies which element is being bound to the event script. A scripting object or element ID can be specified as the element value.

ID

An SGML identifier used as the target for hypertext links or for naming particular elements in associated style sheets. Valid ID values must begin with a letter. The underbar character, "_", may be used in the ID name. The ID should be unique throughout the scope of the document. If more than one object with the same identifier exists in a document, a collection of those named items is created that can only be referenced by ordinal position.

LANGUAGE

Specifies the language the current script is written in and invokes the proper scripting engine. The default value is JAVASCRIPT. This attribute overrides any TYPE= value.
JAVASCRIPT, JSCRIPT-- The scripting language is written in JavaScript.
VBS, VBSCRIPT --The scripting language is written in VBScript.

SRC

Specifies a URL for the associated file.

TITLE

Used to provide advisory information.

TYPE

Specifies the MIME type for the associated scripting engine.

Version

JavaScript Versioin

Internet Explorer

Netscapte

1.0

Supported from Version 3.0

Supported from version 2.0

1.1

IEx 3.0x doesn't support all functionality. IEx 4.0+ does.

Supported from version 3.0

1.2

IEx 3.0x throws ''function' not defined' error. Is supported by IEx 4.0+

Supported by version 4.0

Sample

<SCRIPT LANGUAGE="language" src="url">
<!-- Begin to hide script contents from old browsers.
. . . Script functions/routines go here
End the hiding here.-->
</SCRIPT>

Remarks

This element is a block element. Both the start and end tags are required.