|
|
SCRIPT
The SCRIPT element places a script within the document and
may appear within the HEAD and/or BODY of the document any
number of times.
- src
- The src attribute specifies the location of an external
script.
- type
- The type attribute specifies the scripting language
as 'content type' such as "text/javascript".
- language
- The language attribute has been deprecated in favor
of type. It specifies the scripting language.
Deprecated:
<Script language="JavaScript">
</Script>
|
HTML 4.0
<SCRIPT type="text/javascript">
</SCRIPT>
|
- defer
- The defer attribute tells the user agent that the
script is not going to contain any document content.
For example, it will not contain a "document.write" in
javascript. This allows the user agent to continue
parsing and rendering.
The scripting language must be specified either through
a default declaration in the document HEAD or through
a local declaration.
Within the HEAD
<HEAD>
<TITLE>Hello World Script</TITLE>
<META http-equiv = "Content-Script-Type"
content = "text/javascript">
</HEAD>
|
Within the BODY
<SCRIPT type="text/javascript">
<!--
document.write("Hello World !");
//-->
</SCRIPT>
|
Full Example of Embedding a Script
Deprecated:
<Script language="JavaScript">
<!--
document.write("Hello World !");
//-->
</Script>
|
|
HTML 4.0:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
"http://www.w3.org/TR/REC-html40/strict.dtd">
<HTML>
<HEAD>
<TITLE>Hello World Script</TITLE>
<META http-equiv = "Content-Script-Type"
content = "text/javascript">
</HEAD>
<BODY>
<SCRIPT type="text/javascript">
<!--
document.write("Hello World !");
//-->
</SCRIPT>
</BODY>
</HTML>
|
|
Additional Resources:
HTML 4.01 Tags
|
|