Class CKEDITOR.dom.node
Extends
CKEDITOR.dom.domObject.
Defined in: core/dom/node.js.
Constructor Attributes | Constructor Name and Description |
---|---|
CKEDITOR.dom.node(domNode)
Base class for classes representing DOM nodes.
|
- Fields borrowed from class CKEDITOR.dom.domObject:
- $
Method Attributes | Method Name and Description |
---|---|
appendTo(element, toStart)
Makes this node child of another element.
|
|
clone(includeChildren)
|
|
getAscendant(name, includeSelf)
Gets the closes ancestor node of a specified node name.
|
|
getChild(indices)
Gets a DOM tree descendant under the current node.
|
|
Gets the document containing this element.
|
|
getIndex()
|
|
getNext()
Gets the node following this node (next sibling).
|
|
getNextSourceNode(startFromSibling, nodeType)
|
|
Gets the parent element for this node.
|
|
getPosition(otherNode)
|
|
getPreviousSourceNode(startFromSibling, nodeType)
|
|
hasNext()
|
|
insertAfter(node)
Inserts this element after a node.
|
|
insertBefore(node)
Inserts this element before a node.
|
|
insertBeforeMe(node)
|
|
move(target, toStart)
|
|
remove(preserveChildren)
Removes this node from the document DOM.
|
- Methods borrowed from class CKEDITOR.dom.domObject:
- equals, getCustomData, setCustomData
- Methods borrowed from class CKEDITOR.event:
- fire, fireOnce, hasListeners, implementOn, on, removeListener
Class Detail
CKEDITOR.dom.node(domNode)
Since:
3.0
Base class for classes representing DOM nodes. This constructor may return
and instance of classes that inherits this class, like
CKEDITOR.dom.element or CKEDITOR.dom.text.
- Parameters:
- {Object} domNode
- A native DOM node.
Method Detail
{CKEDITOR.dom.element}
appendTo(element, toStart)
Since:
3.0
Makes this node child of another element.
var p = new CKEDITOR.dom.element( 'p' ); var strong = new CKEDITOR.dom.element( 'strong' ); strong.appendTo( p ); // result: "<p><strong></strong></p>"
- Parameters:
- {CKEDITOR.dom.element} element
- The target element to which append this node.
- {Undefined} toStart
- Returns:
- {CKEDITOR.dom.element} The target element.
{Undefined}
clone(includeChildren)
Since:
3.0
NO EXAMPLE AVAILABLE
- Parameters:
- {Undefined} includeChildren
{CKEDITOR.dom.node}
getAscendant(name, includeSelf)
Since:
3.0
Gets the closes ancestor node of a specified node name.
NO EXAMPLE AVAILABLE
- Parameters:
- {String} name
- Node name of ancestor node.
- {Boolean} includeSelf
- (Optional) Whether to include the current node in the calculation or not.
- Returns:
- {CKEDITOR.dom.node} Ancestor node.
{CKEDITOR.dom.node}
getChild(indices)
Since:
3.0
Gets a DOM tree descendant under the current node.
var strong = p.getChild(0);
- Parameters:
- {Array|Number} indices
- The child index or array of child indices under the node.
- Returns:
- {CKEDITOR.dom.node} The specified DOM child under the current node. Null if child does not exist.
{Undefined}
getChildCount()
Since:
3.0
NO EXAMPLE AVAILABLE
{CKEDITOR.dom.document}
getDocument()
Since:
3.0
Gets the document containing this element.
var element = CKEDITOR.document.getById( 'example' ); alert( element.getDocument().equals( CKEDITOR.document ) ); // "true"
- Returns:
- {CKEDITOR.dom.document} The document.
{Undefined}
getIndex()
Since:
3.0
NO EXAMPLE AVAILABLE
{CKEDITOR.dom.node}
getNext()
Since:
3.0
Gets the node following this node (next sibling).
NO EXAMPLE AVAILABLE
- Returns:
- {CKEDITOR.dom.node} The next node.
{Undefined}
getNextSourceNode(startFromSibling, nodeType)
Since:
3.0
NO EXAMPLE AVAILABLE
- Parameters:
- {Undefined} startFromSibling
- {Undefined} nodeType
{CKEDITOR.dom.element}
getParent()
Since:
3.0
Gets the parent element for this node.
var node = editor.document.getBody().getFirst(); var parent = node.getParent(); alert( node.getName() ); // "body"
- Returns:
- {CKEDITOR.dom.element} The parent element.
{Undefined}
getParents()
Since:
3.0
NO EXAMPLE AVAILABLE
{Undefined}
getPosition(otherNode)
Since:
3.0
NO EXAMPLE AVAILABLE
- Parameters:
- {Undefined} otherNode
{Undefined}
getPrevious()
Since:
3.0
NO EXAMPLE AVAILABLE
{Undefined}
getPreviousSourceNode(startFromSibling, nodeType)
Since:
3.0
NO EXAMPLE AVAILABLE
- Parameters:
- {Undefined} startFromSibling
- {Undefined} nodeType
{Undefined}
hasNext()
Since:
3.0
NO EXAMPLE AVAILABLE
{Undefined}
hasPrevious()
Since:
3.0
NO EXAMPLE AVAILABLE
{CKEDITOR.dom.node}
insertAfter(node)
Since:
3.0
Inserts this element after a node.
var em = new CKEDITOR.dom.element( 'em' ); var strong = new CKEDITOR.dom.element( 'strong' ); strong.insertAfter( em ); // result: "<em></em><strong></strong>"
- Parameters:
- {CKEDITOR.dom.node} node
- The that will preceed this element.
- Returns:
- {CKEDITOR.dom.node} The node preceeding this one after insertion.
{CKEDITOR.dom.node}
insertBefore(node)
Since:
3.0
Inserts this element before a node.
var em = new CKEDITOR.dom.element( 'em' ); var strong = new CKEDITOR.dom.element( 'strong' ); strong.insertBefore( em ); // result: "<strong></strong><em></em>"
- Parameters:
- {CKEDITOR.dom.node} node
- The that will be after this element.
- Returns:
- {CKEDITOR.dom.node} The node being inserted.
{Undefined}
insertBeforeMe(node)
Since:
3.0
NO EXAMPLE AVAILABLE
- Parameters:
- {Undefined} node
{Undefined}
move(target, toStart)
Since:
3.0
NO EXAMPLE AVAILABLE
- Parameters:
- {Undefined} target
- {Undefined} toStart
{Undefined}
remove(preserveChildren)
Since:
3.0
Removes this node from the document DOM.
var element = CKEDITOR.dom.element.getById( 'MyElement' ); element.remove();
- Parameters:
- {Boolean} preserveChildren Optional
- Indicates that the children elements must remain in the document, removing only the outer tags.