Availability: |
| ||||||
Inherits from: | Element object | ||||||
JavaScript syntax: | IE | myMETA = myDocument.all.anElementID | |||||
IE | myMETA = myDocument.all.tags("META")[anIndex] | ||||||
IE | myMETA = myDocument.all[aName] | ||||||
- | myMETA = myDocument.getElementById(anElementID) | ||||||
- | myMETA = myDocument.getElementsByName(aName)[anIndex] | ||||||
- | myMETA = myDocument.getElementsByTagName("META")[anIndex] | ||||||
HTML syntax: | <META> | ||||||
Argument list: | anIndex | A reference to an element in a collection | |||||
aName | An associative array reference | ||||||
anElementID | The ID value of an Element object | ||||||
Object properties: | charset, content, httpEquiv, name, scheme, url | ||||||
Event handlers: | onClick, onDblClick, onHelp, onKeyDown, onKeyPress, onKeyUp, onMouseDown, onMouseMove, onMouseOut, onMouseOver, onMouseUp |
These tags and their corresponding object instantiations are used to convey hidden information about the document. This information might useful to a search engine for example. Sometimes, the server uses the META information to control the way the pages are cached into a proxy. Likewise, a client browser may use these values to control the local caching and expiry times of a document.
There may be several META objects associated with a document. There is no collection object that provides an enumerable set containing only the META objects but you can traverse the document.all[] collection and extract them in MSIE or use the collection returned by the DOM compliant document.getElementsByTagName("META") method which is supported on Netscape 6.0 and recent versions of MSIE. It is possible you might know the unique ID="..." HTML tag attribute value in which case you can access the required object directly.
This is not currently supported at all in Netscape 4.0 although because it is part of the DOM specification, it is added to Netscape 6.0.
Netscape 6.0 returns an undefined value for the charset property and incorrectly appends it to the content property..
For this meta tag:
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
Netscape Navigator 6.0 returns these values:
myMeta.httpEquiv is defined as "Content-Type"
myMeta.content is defined as "text/html; charset=8859-1"
myMeta.charset is undefined
See also: | <META>, Element object, META.charset |
Property | JavaScript | JScript | N | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
---|---|---|---|---|---|---|---|---|---|---|---|
charset | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
content | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
httpEquiv | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
name | 1.5 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
scheme | 1.5 ![]() | 5.0 ![]() | 6.0 ![]() | 5.0 ![]() | ![]() | ![]() | ![]() | 1 ![]() | ![]() | ![]() | - |
url | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
Event name | JavaScript | JScript | N | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
---|---|---|---|---|---|---|---|---|---|---|---|
onClick | 1.0 ![]() | 1.0 ![]() | 6.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onDblClick | 1.2 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onHelp | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
onKeyDown | 1.2 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onKeyPress | 1.2 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onKeyUp | 1.2 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onMouseDown | 1.2 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onMouseMove | 1.2 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onMouseOut | 1.1 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onMouseOver | 1.0 ![]() | 1.0 ![]() | 6.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
onMouseUp | 1.2 ![]() | 3.0 ![]() | 6.0 ![]() | 4.0 ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | 4.0 ![]() | ![]() |
Prev | Home | Next |
<META> | Up | META.charset |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |