Some of the attributes of JavaScript are explained

Source: Internet
Author: User
Tags numeric value object model parse error processing instruction valid xml attribute

Async Property

The Action Async property indicates whether asynchronous downloads are allowed.
Basic grammar boolvalue = Xmldocument.async; Xmldocument.async = Boolvalue;
Indicates that the Boolean value is Erasable (read/write), True if the asynchronous download is allowed, or false for the opposite.
Example

Webjx.com


Xmldoc.async = "false";
alert (Xmldoc.async); Web Teaching Network

=================================================


Attribute Property Web Teaching Network

function returns the list of properties for the current node.
Basic grammar objattributelist = xmlnode.attributes;
Description returns an object. If this node cannot contain a property, the go home value is passed.
Example

Objattlist = xmlDoc.documentElement.attributes;
alert (objattlist);

Web Teaching Network

=================================================

Web Teaching Network

ChildNodes Property

function returns a list of nodes that contain all the available child nodes of the node.
Basic grammar objnodelist=node.childnodes;
Description returns an object. If the node does not have a child node, returns NULL.
Example

objNodeList = Xmldoc.childnodes;
alert (objnodelist);

=================================================

DOCTYPE Property webjx.com

function is passed back to the file type node, containing the DTD for the current file. This node is a general file type declaration, for example, a node that is called an email node object is returned.
Basic grammar objdoctype=xmldocument.doctype;
The description returns an object, which is read-only. If the file does not contain a DTD, it returns NULL.
Example

Web Teaching Network

Objdoctype = Xmldoc.doctype;
alert (objdoctype.nodename);

=================================================

Webjx.com


DocumentElement Property

Web Teaching Network

The function confirms the root node of the XML file.
Basic grammar objdoc=xmldocument.documentelement;
Describes the return of an object that contains data in a single root file element. This property is readable/writable, and NULL is returned if the file does not contain a root node.
Example webjx.com

Objdocroot = xmldoc.documentelement;
alert (objdocroot);

================================================= Web Teaching Network

FirstChild Property

Action confirms the first child element in the current node.
Basic grammar objfirstchild = Xmldocnode.firstchild;
Indicates that this property is read-only and returns an object, which returns null if the node does not contain the first child element.
Example Web Teaching Network

Objfirstchild = XmlDoc.documentElement.firstChild;
alert (objfirstchild); Webjx.com

=================================================

Implementation property

Webjx.com


The Action DOM application can use objects in other implementation. The implementation property confirms the Domimplementation object for the current XML file.
Basic grammar objimplementation = xmldocument.implementation;
Indicates that this property is read-only and returns an object.
Example


Objimp = xmldoc.implementation;
alert (OBJIMP);

================================================= Web Teaching Network

LastChild Property webjx.com

Action confirms the last child element in the current node.
Basic grammar objlastchild = Xmldocnode.lastchild;
Indicates that this property is read-only and returns an object. If the node does not contain the last child element, NULL is returned.
Example

Objlastchild = XmlDoc.documentElement.lastChild;
alert (objlastchild);

================================================= Web Teaching Network

NextSibling Property

The role is passed back to the next sibling node in the list of child nodes of the current file node.
Basic grammar objnextsibling = xmldocnode.nextsibling;
Indicates that this property is read-only and returns an object. Null is returned if the node does not contain other related nodes.
Example

Webjx.com


objsibling = XmlDoc.documentElement.childNodes.item (1). nextSibling;
alert (objsibling);

=================================================

NodeName Property webjx.com

Action returns a string representing the current node name.
Basic grammar strnodename = Xmldocnode.nodename;
Description returns a string. This property is read-only and returns the element name, attribute, or entity reference.
Example Web Teaching Network

Strnodename = XmlDoc.documentElement.nodeName;
alert (strnodename);

Web Teaching Network


================================================= webjx.com

NodeType Property

Webjx.com

The function identifies the DOM type of the node.
Basic grammar numnodetype = Xmldocnode.nodetype;
Indicates that this property is read-only and returns a numeric value.

Web Teaching Network

Valid values correspond to the following types:
1-element
2-attribute
3-text
4-cdata
5-entity REFERENCE
6-entity
7-PI (processing instruction)
8-comment
9-document
10-document TYPE
11-document FRAGMENT
12-notation
 
Example webjx.com

Numnodetype = XmlDoc.documentElement.nodeType;
alert (Numnodetype);

=================================================

NodeValue Property

Action returns the text associated with the specified node. This is not the value of the data in an element, but rather the unresolved text associated with a node, like a property or a processing instruction.
Basic grammar varnodevalue = Xmldocnode.nodevalue;
Note the text that is returned represents a type value that is based on the NodeType property of the node. (Refer to the NodeType property in the appendix.) Because the node type may be one of several data types, the return value is therefore different. The node types that return null are: Document, ELEMENT, document TYPE, document FRAGMENT, ENTITY, ENTITY REFERENCE, and notation. This property can be erased.
Example webjx.com

Varnodevalue = XmlDoc.documentElement.nodeValue;
alert (Varnodevalue);

Web Teaching Network

=================================================

Webjx.com


ondataavailable Property

Web Teaching Network

ACTION specifies an event to handle the ondataavailable event.
Basic syntax xmldocnode.ondataavailable = value;
Indicates that this property is write-only, allowing file authors to work with data as quickly as possible once the data is available.
Example

xmldoc.ondataavailable = Alert ("Data is now available.");


=================================================

onReadyStateChange Property Web Teaching Network

ACTION specifies an event to handle the onReadyStateChange event. This event can identify changes in readystate properties.
Basic syntax xmldocnode.onreadystatechange = value;
Indicates that this property is write-only, allowing the file author to specify a call event when the ReadyState property changes.
Example

Xmldoc.onreadystatechange = Alert ("The ReadyState property has changed.");


=================================================

Ownerdocument Property webjx.com

The function is passed back to the root node of the file, containing the current node.
Basic grammar objownerdoc = xmldocument.ownerdocument;
Indicates that this property is read-only and returns an object containing the root node of the file, containing a specific node.
Example webjx.com

Objownerdoc = XmlDoc.childNodes.item (2). Ownerdocument;
alert (Objownerdoc); Webjx.com

=================================================


ParentNode Property

Webjx.com


function is passed back to the parent node of the current node. Can only be applied to nodes that have parent nodes.
Basic grammar objparentnode = Xmldocumentnode.parentnode;
Indicates that this property is read-only and returns the parent node object that contains the specified node. If this node does not exist in the file tree, NULL is returned.
Example webjx.com

Objparentnode = XmlDoc.childNodes.item (1). parentnode;
alert (Objparentnode); Webjx.com

=================================================

ParseError Property Web Teaching Network

The function returns a DOM parse Error object that describes the last message parsing the error.
Basic grammar objparseerr = Xmldocument.parseerror;
Indicates that this property is read-only. If no error occurs, 0 is returned.
Example

Objparseerr = Xmldoc.parseerror;
alert (OBJPARSEERR);

=================================================

Webjx.com


PreviousSibling Property

The function is passed back to the sibling node before the current node.
Basic grammar objprevsibling = xmldocument.previoussibling;
The description returns an object, which is read-only. If the node does not contain the preceding sibling node, it returns NULL.
Example Web Teaching Network

objprevsibling = XmlDoc.documentElement.childNodes.item (3). previoussibling;
alert (objprevsibling); Web Teaching Network

=================================================

Webjx.com

ReadyState Property webjx.com

Effect returns the current status of XML file data.
Basic grammar intstate = xmldocument.readystate;
Indicates that this property is read-only, and the return value has the following potential:
The 0-uninitialized:xml object is generated, but no files are loaded.
1-loading: Loader is in progress, but file has not started parsing.
2-loaded: Part of the file has been loaded and parsed, but the object model has not yet taken effect.
3-interactive: Only the partially loaded files are valid, in which case the object model is valid but read-only.
4-completed: The file is fully loaded and represents a successful load.
Example webjx.com

Alert ("The ReadyState property is" + Xmldoc.readystate);

Web Teaching Network

=================================================

URL Property

The function returns the URL of the most recent loaded XML file.
Basic grammar strdocurl = Xmldocument.url;
Indicates that this property is read-only, returns the URL to the last load success file, and returns null if the file exists only in main storage (which means that the file is not loaded by an external file).
Example

alert (Xmldoc.url); Webjx.com

=================================================

Validateonparse Property


Action tells the parser whether the file is valid.
Basic grammar boolvalidate = Xmldocument.validateonparse; Xmldocument.validateonparse = boolvalidate;
Indicates that this property is erasable. If the return value is true, it is validated that the file is resolved. If returned false, the file is invalid and is considered to be a standard format (well-formed) file.
Example

Xmldoc.validateonparse = true;
alert (xmldoc.validateonparse); Web Teaching Network

=================================================


XML attribute

Action returns the XML description and all child nodes of the specified node.
Basic grammar xmlvalue = Xmldocumentnode.xml;
Indicates that this property is read-only.
Example

Web Teaching Network


Xmlvalue = XmlDoc.documentElement.xml;
alert (Xmlvalue);

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.