Code Index | File Index

Namespaces

Classes


Class CKEDITOR.dom.node


Extends CKEDITOR.dom.domObject.

Defined in: core/dom/node.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Base class for classes representing DOM nodes.
Field Summary
Field Attributes Field Name and Description
 
$
The native DOM node represented by this class instance.
Method Summary
Method Attributes Method Name and Description
 
appendTo(element)
Makes this node child of another element.
 
Gets the parent element for this node.
 
Inserts this element after a node.
 
Inserts this element before a node.
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.
See:
CKEDITOR.dom.element
CKEDITOR.dom.text
Field Detail
{Object} $
Since: 3.0
The native DOM node represented by this class instance.
var element = new CKEDITOR.dom.node( document.body );
alert( element.$.nodeType );  // "1"
Method Detail
{CKEDITOR.dom.element} appendTo(element)
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.
Returns:
{CKEDITOR.dom.element} The target element.

{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.

{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 after this one after insertion.

Documentation generated by JsDoc Toolkit