HTML and CSS Reference
In-Depth Information
type : the content type of the embedded style information. This attribute's value must be a valid
Internet media type (also known as the content type or MIME type). It will almost always be
text/css in HTML and XHTML documents, and web browsers will assume that content type if
the attribute is omitted.
script
The script element encloses a series of instructions written in a scripting language, or it may link to an
external script file specified by a URL in a src attribute. These scripts—almost always written in the
JavaScript language—are processed and executed by the browser to perform a wide range of tasks, from
fairly simple calculations to extremely complicated interactions and animated effects. The script element
requires an end tag and cannot contain any HTML; the entire contents of a script element should be
written in the particular scripting language.
An optional type attribute indicates the content type of the enclosed script, which is text/javascript for
scripts written in JavaScript. There may be other scripting languages, such as Microsoft's proprietary
VBScript, but they're rather obscure and rarely seen (VBScript is only supported by Internet Explorer).
JavaScript is far and away the most ubiquitous scripting language on the Web, and browsers will assume
a content type of text/javascript if the type attribute is omitted from a script element.
JAVASCRIPT
JavaScript is a scripting language. Unlike a full-fledged programming language that can execute all of its
own commands, a scripting language only passes instructions to another program to execute. In the case
of JavaScript, the program that does the real work is the web browser.
With JavaScript, web developers can dynamically manipulate HTML documents, creating, destroying,
moving, and modifying elements and content on the fly as it lives in the browser. JavaScript can also
facilitate communication between the browser and server, setting and reading cookies, or fetching new
data from the server without reloading the page. It's a powerful and complex language in its own right, and
is a subject for other, more advanced topics than this one. We won't be delving into JavaScript in any
detail in these pages.
Even so, JavaScript rarely exists independent of HTML, and indeed a great deal of what JavaScript does is
manipulate the same markup and CSS you'll be seeing throughout this topic. Scripting adds a progressive
layer of behavior and interactivity on top of the underlying layers of content, structure, and presentation.
JavaScript should not be confused with the Java programming language—though the names are similar,
Java and JavaScript have almost nothing in common.
Search WWH ::




Custom Search