Availability
DOM Level 2 StyleSheets
Properties
readonly unsigned long length
The length
of the array; the number of media types in the list.
String mediaText
A
comma-separated text representation of the complete media list.
Setting this property may throw a DOMException with a
code of SYNTAX_ERR if the new
value contains a syntax err, or a code of
NO_MODIFICATION_ALLOWED_EXCEPTION if the media
list is read-only.
Methods
appendMedium( )
Adds a new media type to the end of the list. deleteMedium( )
Removes the specified media type from the list. item( )
Returns the media type at the specified position in the list, or
null if the index is invalid. In JavaScript, you
can also treat the MediaList object as an array and index it using
normal square-bracket array notation instead of calling this method.
Description
This interface represents a list or array of media types for a style
sheet. length specifies the number of elements in
the list, and item( ) allows a specific media type
to be retrieved by position. appendMedium( ) and
deleteMedium( ) allow entries to be appended to
and deleted from the list. JavaScript allows a MediaList object to be
treated as an array, and you can use square-bracket notation instead
of calling item( ).
The HTML 4 standard defines the following media types (they are
case-sensitive, and must be written in lowercase letters):
screen, tty,
tv, projection,
handheld, print,
braile, aural, and
all. The screen type is most
relevant to documents being displayed in web browsers on desktop or
laptop computers. The print type is used for
styles intended for printed documents.
See Also
Type of
StyleSheet.media
•
Table of Contents
•
Index
•
Reviews
•
Examples
•
Reader Reviews
•
Errata
JavaScript: The Definitive Guide, 4th Edition
By
David Flanagan
Publisher
: O'Reilly
Pub Date
: November 2001
ISBN
: 0-596-00048-0
Pages
: 936
Slots
: 1
This fourth edition of the definitive reference to
JavaScript, a scripting language that can be embedded
directly in web pages, covers the latest version of the
language, JavaScript 1.5, as supported by Netscape 6 and
Internet Explorer 6. The book also provides complete
coverage of the W3C DOM standard (Level 1 and Level 2),
while retaining material on the legacy Level 0 DOM for
backward compatibility.