Trait

io.scalajs.dom

CharacterData

Related Doc: package dom

Permalink

trait CharacterData extends Object with Node

The CharacterData interface provides a set of properties and methods for working with text content (referred to as character data) in the DOM. This interface doesn't represent any actual object, but is inherited by other interfaces which do — Text, Comment and CDATASection.

Annotations
@RawJSType() @native()
See also

http://reference.sitepoint.com/javascript/CharacterData/deleteData

Linear Supertypes
Node, Object, Any, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CharacterData
  2. Node
  3. Object
  4. Any
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def appendChild(node: Node): Node

    Permalink

    Add a new node (and its subtree, if applicable) to the end of the list of children of this node.

    Add a new node (and its subtree, if applicable) to the end of the list of children of this node.

    If the new child is already present in the DOM tree it is first removed (effectively moving it). If the new child is a DocumentFragment node then the entire contents of the document fragment are appended, but the fragment node itself is not (therefore using a document fragment is a good way of building and attaching several nodes at once).

    node

    The new node to be added to this node. If the new node has any children these are also added recursively, preserving the new node's sub-tree.

    returns

    The node that was added

    Definition Classes
    Node
  5. def appendData(string: String): Unit

    Permalink

    Append a string to the end of this character data.

    Append a string to the end of this character data. After a successful operation, the data and length properties of the node reflect the change.

    string

    The string to append.

  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def attributes: NamedNodeMap[Attr]

    Permalink

    The attributes collection is an unordered list of all the effective attributes1 of an Element; for other nodes this property is null.

    The attributes collection is an unordered list of all the effective attributes1 of an Element; for other nodes this property is null.

    This collection is a NamedNodeMap, primarily intended to be accessed by name. It's also possible to access the items by their index in the map, however the DOM does not specify what order they will appear in (and this varies by browser, as noted in the Compatibility notes below).

    As with all named node maps, attributes is a live collection, which means that changes to the collection it represents are immediately reflected in the node map (as opposed to it being a static snapshot). This collection is read-only.

    Definition Classes
    Node
  8. def childNodes[T <: Node]: NodeList[T]

    Permalink

    The childNodes collection is an ordered list of all the direct child nodes of this node; if there are no child nodes then this collection is empty (it has zero length).

    The childNodes collection is an ordered list of all the direct child nodes of this node; if there are no child nodes then this collection is empty (it has zero length). The childNodes collection is a NodeList, in which the items are indexed numerically, and appear in source order.

    As with all node lists, childNodes is a live collection, which means that changes to the collection it represents are immediately reflected in the node list (as opposed to it being a static snapshot).

    Attributes of an element are not considered child nodes, and therefore don’t appear in the childNodes collection2 This collection is read only.

    returns

    an ordered list of all the direct child nodes of this node

    Definition Classes
    Node
  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def cloneNode(deep: Boolean): CharacterData.this.type

    Permalink

    Creates a duplicate of this node, including all attributes and their values (including attributes which are not explicitly defined but which have a default value in this document type).

    Creates a duplicate of this node, including all attributes and their values (including attributes which are not explicitly defined but which have a default value in this document type). The duplicate node has no parent (parentNode is null) until it's added to the document, for example using appendChild.

    If the deep argument is included and has the value true then the node's sub-tree (if any) will also be duplicated.

    Cloning a sub-tree that is readonly results in a sub-tree that can be modified (ie. the sub-tree of a cloned node is always mutable, even if the original was immutable), with the exception that the children of a cloned EntityReference are always readonly.

    Cloning an Element node also copies its attributes (including any default attributes), but does not copy its text unless the deep argument is true.

    Cloning an Attr node directly (as opposed to attributes that belong to a cloned Element) creates a node for which the specified property is true.

    Whether a Document, DocumentType, Entity or Notation node may be cloned is not defined by the DOM, and depends on the implementation (see Compatibility notes below).

    deep

    If true duplicate the node's sub-tree as well as the node itself. If false only copy the node (and its attributes, if it's an Element).

    returns

    The duplicate node.

    Definition Classes
    Node
  11. def data: String

    Permalink

    The character data of a Text, Comment or CDATASection node, or the data in a ProcessingInstruction node.

    The character data of a Text, Comment or CDATASection node, or the data in a ProcessingInstruction node. This property is read/write.

  12. def deleteData(offset: Int, count: Int): Unit

    Permalink

    Delete a string from this character data, between specified offsets.

    Delete a string from this character data, between specified offsets. After a successful operation, the data and length properties of the node reflect the change.

    offset

    The character offset from which to start removing.

    count

    The number of characters to delete. If offset plus count exceeds the length of the data then everything from offset to the end is deleted.

  13. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def firstChild[T <: Node]: T

    Permalink

    The first node that is a direct child of this node (ie.

    The first node that is a direct child of this node (ie. this node is its parent and it appears at the beginning of the childNodes collection), or null if there is no such node. This property is readonly.

    returns

    The first node that is a direct child of this node

    Definition Classes
    Node
  17. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  18. def hasAttributes(): Boolean

    Permalink

    Returns whether an Element node has any attributes.

    Returns whether an Element node has any attributes.

    returns

    true if this node is an Element and has any effective attributes, otherwise false

    Definition Classes
    Node
  19. def hasChildNodes(): Boolean

    Permalink

    Test whether a node has any child nodes; equivalent to evaluating whether the childNodes collection has a length greater than zero.

    Test whether a node has any child nodes; equivalent to evaluating whether the childNodes collection has a length greater than zero.

    returns

    true if this node has any children, otherwise false

    Definition Classes
    Node
  20. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  21. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  22. def insertBefore(newNode: Node, existingChild: Node): Node

    Permalink

    Insert a new node as a child of this node, directly before an existing child of this node, or at the end of the list of children if no existing child is specified or it's null.

    Insert a new node as a child of this node, directly before an existing child of this node, or at the end of the list of children if no existing child is specified or it's null. If the new child is already present in the DOM tree it is first removed (effectively moving it).

    newNode

    The new node to insert.

    existingChild

    An existing child node that the new node should be inserted before. If this argument is null, the new node is inserted at the end of this node's list of children.

    returns

    the inserted node

    Definition Classes
    Node
  23. def insertData(offset: Int, string: String): Unit

    Permalink

    Insert a string into this character data at a specified character offset.

    Insert a string into this character data at a specified character offset. After a successful operation, the data and length properties of the node reflect the change.

    offset

    The character offset at which to insert.

    string

    The string to insert.

  24. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  25. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  26. def isSupported(feature: String, version: String = js.native): Boolean

    Permalink

    Test whether a specific feature of the DOM is implemented, and supported by this node.

    Test whether a specific feature of the DOM is implemented, and supported by this node.

    This method is essentially the same as hasFeature, except that it's concerned with whether a feature is supported by a specific node, rather than whether it's implemented in general.

    feature

    The name of the feature to test, using one of the values defined in the DOM 2 Conformance list.

    version

    The DOM version to test. For DOM 2 this is always the value 2.0. If this argument is not specified, the method will return true if the feature is supported at any DOM level.

    returns

    true if the feature is implemented and supported on this node, otherwise false

    Definition Classes
    Node
  27. def lastChild: Node

    Permalink

    The last node that is a direct child of this node (ie.

    The last node that is a direct child of this node (ie. this node is its parent and it appears at the end of the childNodes collection), or null if there is no such node. This property is readonly.

    returns

    The last node that is a direct child of this node

    Definition Classes
    Node
  28. def length: Int

    Permalink

    The number of items in a collection (a NamedNodeMap or NodeList), or the number of characters in the string value of a character data node (CDATASection, Comment or Text).

  29. def localName: String

    Permalink

    The local name (ie.

    The local name (ie. not including any namespace prefix) of a Element or Attr node; for other nodes this property is null.

    DOM 1 methods such as getAttribute are not namespace aware, and identify nodes by their nodeName. Namespace aware DOM 2 methods such as getAttributeNS identify nodes by a combination of their namespaceURI and localName; the localName and prefix combined form a qualified name — a name which comprises the namespace prefix then the local name, delimited with a colon. This property is readonly.

    returns

    The local name

    Definition Classes
    Node
  30. def namespaceURI: String

    Permalink

    The namespace URI of an Element or Attr node.

    The namespace URI of an Element or Attr node. For other nodes, or elements or attributes created with a DOM 1 method that isn't namespace aware (such as createElement), or nodes with no namespace, this property is null.

    This should not be a computed value or lookup of the namespace an element should have, it should be the literal value that it does have.

    An Element node can inherit its namespace from an ancestor. However Attr nodes do not inherit a namespace from the element they're attached to — if an attribute does not have an explicitly defined namespace then it simply has no namespace. This property is readonly.

    returns

    The namespace URI

    Definition Classes
    Node
  31. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  32. def nextSibling: Node

    Permalink

    The node immediately after this node (ie.

    The node immediately after this node (ie. both nodes have the same parent and are next to each other in its childNodes collection), or null if there is no such node. This property is readonly.

    returns

    The node immediately after this node

    Definition Classes
    Node
  33. def nodeName: String

    Permalink

    The name of this node

    The name of this node

    Definition Classes
    Node
  34. def nodeType: NodeType

    Permalink

    A numeric code that represents the type of this node +---------------------------+----+ | Element | 1 | | Attr | 2 | | Text | 3 | | CDATASection | 4 | | EntityReference | 5 | | Entity | 6 | | ProcessingInstruction | 7 | | Comment | 8 | | Document | 9 | | DocumentType | 10 | | DocumentFragment | 11 | | Notation | 12 | +---------------------------+----+

    A numeric code that represents the type of this node +---------------------------+----+ | Element | 1 | | Attr | 2 | | Text | 3 | | CDATASection | 4 | | EntityReference | 5 | | Entity | 6 | | ProcessingInstruction | 7 | | Comment | 8 | | Document | 9 | | DocumentType | 10 | | DocumentFragment | 11 | | Notation | 12 | +---------------------------+----+

    returns

    the numeric code

    Definition Classes
    Node
    See also

    NodeTypes

  35. def nodeValue: Any

    Permalink

    The value of this node

    The value of this node

    Definition Classes
    Node
  36. def normalize(): Unit

    Permalink

    Puts this node's sub-tree in a state whereby only structural nodes separate Text nodes.

    Puts this node's sub-tree in a state whereby only structural nodes separate Text nodes.

    When a document is first loaded there will be only one Text node for each block of text. Operations such as splitText may divide blocks of text into multiple sibling Text nodes, as may creating and adding new Text nodes, but such divisions will not persist between sessions. The normalize method merges adjacent nodes to [re]create the load state of a single Text node for each block of text.

    Definition Classes
    Node
  37. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  38. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  39. def ownerDocument: Document

    Permalink

    The Document which contains this node; or null if this node is itself a Document, or a DocumentType that is not associated with any document.

    The Document which contains this node; or null if this node is itself a Document, or a DocumentType that is not associated with any document. This property is read-only.

    Definition Classes
    Node
  40. def parentNode: Node

    Permalink

    The parent of this node; or null if it has no parent.

    The parent of this node; or null if it has no parent.

    Nodes which have just been created but not added to the document, or have just been removed from the document, or are Attr, Document, DocumentFragment or Entity nodes, do not have a parent. This property is readonly.

    Definition Classes
    Node
  41. def prefix: String

    Permalink

    The namespace prefix of this node; or null if this node has no namespace.

    The namespace prefix of this node; or null if this node has no namespace.

    Only namespaced elements and attributes have a prefix; for other nodes, or for elements or attributes created with a non-namespace-aware method such as createElement, the prefix property is null.

    Changing this value may also change the nodeName of this node (since the node name of a namespaced node is a combination of of localName and prefix), as well as the tagName and name properties of elements and attributes (respectively).

    Changing the prefix of an element or attribute that has a default value in this document type does not cause a new default node to be created (ie. the prefix change might mean that the default is no longer present, but a new default will not appear to replace it). This property is read/write.

    Definition Classes
    Node
  42. def previousSibling: Node

    Permalink

    The node immediately before this node (ie.

    The node immediately before this node (ie. both nodes have the same parent and are next to each other in its childNodes collection), or null if there is no such node. This property is readonly.

    Definition Classes
    Node
  43. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  44. def removeChild(oldNode: Node): Unit

    Permalink

    Removes a specified node from the children of this node.

    Removes a specified node from the children of this node.

    oldNode

    The node to be removed.

    Definition Classes
    Node
  45. def replaceChild(newChild: Node, existingChild: Node): Node

    Permalink

    Replace an existing child of this node with a new child node.

    Replace an existing child of this node with a new child node. If the new child is already present in the DOM tree it is first removed (effectively moving it).

    newChild

    The node to be added.

    existingChild

    The node to be removed and replaced.

    returns

    The node that was removed

    Definition Classes
    Node
  46. def replaceData(offset: Int, count: Int, string: String): Unit

    Permalink

    Insert a string to replace the character data between specified offsets, equivalent to deleteData and insertData in a single operation.

    Insert a string to replace the character data between specified offsets, equivalent to deleteData and insertData in a single operation. After a successful operation, the data and length properties of the node reflect the change.

    offset

    The character offset from which to start replacing.

    count

    The number of characters to replace. If offset plus count exceeds the length of the data then everything from offset to the end is replaced (equivalent to calling deleteData with the specified offset and count, followed by appendData with the specified string).

    string

    The string with which the specified range is to be replaced.

  47. def substringData(offset: Int, count: Int): String

    Permalink

    Extract the character data between specified character offsets.

    Extract the character data between specified character offsets.

    offset

    The character offset to start from.

    count

    The number of characters to return. If offset plus count exceeds the length of the data then everything from offset to the end is returned.

    returns

    the character data between specified character offsets.

  48. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  49. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  50. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  51. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  52. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  53. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  54. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Node

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped