Table of Contents

Class CharacterData

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The CharacterData abstract interface represents a Node object that contains characters. This is an abstract interface, meaning there aren't any objects of type CharacterData: it is implemented by other interfaces like Text, Comment, CDATASection, or ProcessingInstruction, which aren't abstract.

[Value("CharacterData")]
public class CharacterData : Node, NonDocumentTypeChildNode, ChildNode
Inheritance
CharacterData
Implements
Derived
Inherited Members

Remarks

-The DOM overview page.
-The concrete interfaces implemented it: Text, CDATASection, ProcessingInstruction, and Comment.

See also on MDN

Constructors

CharacterData()

public CharacterData()

Properties

Data

The data property of the CharacterData interface represent the value of the current object's data.

[Value("data")]
public string Data { get; set; }

Property Value

string

A string with the character information contained in the CharacterData node.When set to the null value, that null value is converted to the empty string (""), so cd.data = null is equivalent to cd.data = "".

Remarks

-Length returning the length of the data contained in the CharacterData node.

See also on MDN

Length

The read-only CharacterData.length property
returns the number of characters in the contained data, as a positive integer.

[Value("length")]
public ulong Length { get; }

Property Value

ulong

A positive integer with the length of the Data string.

Remarks

Methods

AppendData(string)

The appendData() method of the CharacterData interface
adds the provided data to the end of the node's current data.

[Value("appendData")]
public GlobalObject.Undefined AppendData(string data)

Parameters

data string

Returns

GlobalObject.Undefined

None.

Remarks

DeleteData(ulong, ulong)

The deleteData() method of the CharacterData interface
removes all or part of the data from this CharacterData node.

[Value("deleteData")]
public GlobalObject.Undefined DeleteData(ulong offset, ulong count)

Parameters

offset ulong
count ulong

Returns

GlobalObject.Undefined

None.

Remarks

InsertData(ulong, string)

The insertData() method of the CharacterData interface
inserts the provided data into this CharacterData node's current data,
at the provided offset from the start of the existing data.
The provided data is spliced into the existing data.

[Value("insertData")]
public GlobalObject.Undefined InsertData(ulong offset, string data)

Parameters

offset ulong
data string

Returns

GlobalObject.Undefined

None.

Remarks

ReplaceData(ulong, ulong, string)

The replaceData() method of the CharacterData interface removes a certain number of characters of the existing text in a given CharacterData node and replaces those characters with the text provided.

[Value("replaceData")]
public GlobalObject.Undefined ReplaceData(ulong offset, ulong count, string data)

Parameters

offset ulong
count ulong
data string

Returns

GlobalObject.Undefined

None.

Remarks

SubstringData(ulong, ulong)

The substringData() method of the CharacterData interface
returns a portion of the existing data,
starting at the specified index
and extending for a given number of characters afterwards.

[Value("substringData")]
public string SubstringData(ulong offset, ulong count)

Parameters

offset ulong
count ulong

Returns

string

A string with the substring.

Remarks