<script> Tag Attributes

Attributes of the <script> tag
global attributes In addition to the personal attributes of the <script> tag below, any of the common HTML attributes can also be coded.
async="async" Sets the value of the <script async> boolean attribute to true. Omitting it sets to false.
charset
defer="defer" Sets the value of the <script defer> boolean attribute to true. Omitting it sets to false.
language deprecated - use the type attribute instead
src

a URI reference that resolves to the URL of a resource with JavaScript code

Use percent escape codes as explained in the URL-encoding tutorial for any special characters in the URI reference.

If the value of the src attribute resolves to an HTTP URL, it may contain any of the following components:

  1. protocol scheme, typically http: or else https:
  2. username, followed by an "@"
  3. host name or IP address
  4. port number, which defaults to 80 for the http scheme and 443 for the https scheme
  5. absolute or relative path
  6. search query, indicated by "?"

If the protocol scheme, username, host name/IP address and port number are omitted the default is the current host - the same server as the base of the current document. If the path starts with a slash /..., it is an absolute path from the document root directory (AKA "web root") on the server. A relative path will be resolved relative to the base of the current document.

type type="text/javascript" (default)
type="application/ecmascript"
type="application/javascript"
type="application/x-ecmascript"
type="application/x-javascript"
type="text/ecmascript"
type="text/javascript1.0"
type="text/javascript1.1"
type="text/javascript1.2"
type="text/javascript1.3"
type="text/javascript1.4"
type="text/javascript1.5"
type="text/jscript"
type="text/livescript"
type="text/x-ecmascript"
type="text/x-javascript"
type="text/javascript;e4x=1"