In addition to the properties it inherits from the DOMNode interface, the DOMCharacterData interface supports two properties, data and length.
data | |
Access | Read/write |
Type | String |
Description | The character data of the node that implements this interface. Assignment is not implemented; see the second example below for a workaround. |
Usage | |
JScript |
vbl = DOMCharacterData_object.data; DOMCharacterData_object.data = strText; |
VBScript |
vbl = DOMCharacterData_object.data DOMCharacterData_object.data = strText |
Example |
// SoftQuad Script Language JSCRIPT: var text = ActiveDocument.documentElement.firstChild; // Using CharacterData interface through Text object Application.Alert(text.data); // SoftQuad Script Language JSCRIPT: // Assume DOMCharacterData object is // in variable "cdnode". // Substitute for 'cdnode.data="String";' Selection.SelectNodeContents(cdnode); Selection.Text = "String"; |
length | |
Access | Read-only |
Type | Long |
Description | The number of characters available through the data property and the substringData method. |
Usage | |
JScript | DOMCharacterData_object.length; |
VBScript | DOMCharacterData_object.length |
Example |
// SoftQuad Script Language JSCRIPT: var text = ActiveDocument.documentElement.firstChild; Application.alert(text.length); |
Copyright © SoftQuad Software Inc. 1999