Availability: |
| |||
Inherits from: | Element object | |||
JavaScript syntax: | IE | myXML = myDocument.all.anElementID | ||
IE | myXML = myDocument.all.tags("XML")[anIndex] | |||
IE | myXML = myDocument.all[aName] | |||
- | myXML = myDocument.getElementById(anElementID) | |||
- | myXML = myDocument.getElementsByName(aName)[anIndex] | |||
- | myXML = myDocument.getElementsByTagName("XML")[anIndex] | |||
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: | canHaveHTML, defer, event, htmlFor, src, text, type | |||
Event handlers: | onDataAvailable, onDatasetChanged, onDatasetComplete, onReadyStateChange, onRowEnter, onRowExit, onRowsDelete, onRowsInserted |
The MSIE browser can now cope with pages delivered as arbitrary blocks of XML. If it encounters an <XML> tag, then it will instantiate one of these objects to provide JavaScript binding to it. This can also be used to build a small island of XML based content in the middle of an HTML page.
The XML data can sit in an HTML page like this:
<XML ID="myBlock"> <METADATA> <OWNER>Wrox</OWNER> <DATATYPE>Example</DATATYPE> <ABSTRACT>This is an example block of text</ABSTRACT> </METADATA> </XML>
Accessing the text property of the XML object will return all the inner text inside it. To access the components you will need to access the XMLDocument property to expose a DOM document interface. This can be explored using DOM compatible methods and properties.
See also: | Document.readyState, onRowEnter, onRowExit |
Property | JavaScript | JScript | Nav | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
---|---|---|---|---|---|---|---|---|---|---|---|
canHaveHTML | ![]() | 5.0 ![]() | ![]() | 5.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
defer | ![]() | 5.0 ![]() | ![]() | 5.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
event | ![]() | 5.0 ![]() | ![]() | 5.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
htmlFor | ![]() | 5.0 ![]() | ![]() | 5.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
src | ![]() | 5.0 ![]() | ![]() | 5.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
text | ![]() | 5.0 ![]() | ![]() | 5.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
type | ![]() | 5.0 ![]() | ![]() | 5.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
Event name | JavaScript | JScript | Nav | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
---|---|---|---|---|---|---|---|---|---|---|---|
onDataAvailable | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
onDatasetChanged | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
onDatasetComplete | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
onReadyStateChange | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
onRowEnter | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
onRowExit | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
onRowsDelete | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
onRowsInserted | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
Prev | Home | Next |
XML name | Up | XML.defer |
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. |