|
|
HTML <script> tag
Syntax
<script> - </script>
Definition and Usage
The SCRIPT element specifies a script for the page that is interpreted
by a script engine, such as java script.
Required Attributes
| Attribute |
Value |
Description |
| type |
text/ecmascript
text/javascript
text/jscript
text/vbscript
text/vbs
text/xml |
Indicates the MIME type of the script |
Optional Attributes
| Attribute |
Value |
Description |
| charset |
charset |
Defines the character encoding used in script |
| defer |
defer |
Indicates that the script is not going to generate any
document content. The browser can continue parsing and drawing the page |
| language |
javascript
livescript
vbscript
other |
Specifies the scripting language. Deprecated.
Use the type attribute instead. |
| src |
URL |
Defines an URL to a file that contains the script
(instead of inserting the script into your HTML document, you can refer
to a file that contains the script) |
Standard Attributes
For a full description, go to Standard
Attributes.
Example
| Source |
Output |
<SCRIPT type="text/javascript"><!--
document.write("/cgi-bin/connect.cgi?");
document.write("usr=00027147P500");
document.write("&refer="+escape(document.referrer)+"");
document.write("&tips="+Math.random()+"");
file://--></SCRIPT>
|
|
|
|