# CKEditor 3.0 JavaScript API Documentation

Code Index | File Index

## Namespaces

- CKEDITOR
- CKEDITOR.ajax
- CKEDITOR.config
- CKEDITOR.dom
- CKEDITOR.dtd
- CKEDITOR.env
- CKEDITOR.imageCacher
- CKEDITOR.loader
- CKEDITOR.plugins
- CKEDITOR.resourceManager
- CKEDITOR.scriptLoader
- CKEDITOR.skins
- CKEDITOR.test
- CKEDITOR.themes
- CKEDITOR.tools

## Classes

- CKEDITOR.commandDefinition
- CKEDITOR.dialog
- CKEDITOR.dialog.buttonDefinition
- CKEDITOR.dialog.contentDefinition
- CKEDITOR.dialog.contentDefinitionObject
- CKEDITOR.dialog.dialogDefinition
- CKEDITOR.dialog.dialogDefinitionObject
- CKEDITOR.dialog.uiElementDefinition
- CKEDITOR.dialogCommand
- CKEDITOR.dom.document
- CKEDITOR.dom.domObject
- CKEDITOR.dom.element
- CKEDITOR.dom.event
- CKEDITOR.dom.node
- CKEDITOR.dom.selection
- CKEDITOR.dom.text
- CKEDITOR.dom.window
- CKEDITOR.editor
- CKEDITOR.event
- CKEDITOR.eventInfo
- CKEDITOR.focusManager
- CKEDITOR.htmlParser
- CKEDITOR.htmlParser.cdata
- CKEDITOR.htmlParser.comment
- CKEDITOR.htmlParser.element
- CKEDITOR.htmlParser.fragment
- CKEDITOR.htmlParser.text
- CKEDITOR.htmlWriter
- CKEDITOR.keystrokeHandler
- CKEDITOR.pluginDefinition
- CKEDITOR.ui
- CKEDITOR.ui.button
- CKEDITOR.ui.dialog.button
- CKEDITOR.ui.dialog.checkbox
- CKEDITOR.ui.dialog.file
- CKEDITOR.ui.dialog.fileButton
- CKEDITOR.ui.dialog.hbox
- CKEDITOR.ui.dialog.html
- CKEDITOR.ui.dialog.labeledElement
- CKEDITOR.ui.dialog.radio
- CKEDITOR.ui.dialog.select
- CKEDITOR.ui.dialog.textarea
- CKEDITOR.ui.dialog.textInput
- CKEDITOR.ui.dialog.uiElement
- CKEDITOR.ui.dialog.vbox
- CKEDITOR.ui.handlerDefinition
- CKEDITOR.xml

# Class CKEDITOR.dom.text

Extends CKEDITOR.dom.node.
Defined in: core/dom/text.js.

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| CKEDITOR.dom.text(text, ownerDocument) Represents a DOM text node.

Field Summary
Field Attributes | Field Name and Description
--- | ---
| $ The native DOM text node represented by this class instance.
| type The node type.

Method Summary
Method Attributes | Method Name and Description
--- | ---
| getLength()
| getText()
| split(The) Breaks this text node into two nodes at the specified offset, keeping both in the tree as siblings.
| substring(indexA, indexB) Extracts characters from indexA up to but not including indexB.

Methods borrowed from class CKEDITOR.dom.node:
  appendTo, clone, getAddress, getAscendant, getCommonAncestor, getDocument, getIndex, getNext, getNextSourceNode, getParent, getParents, getPosition, getPrevious, getPreviousSourceNode, hasAscendant, hasNext, hasPrevious, insertAfter, insertBefore, insertBeforeMe, ltrim, move, remove, replace, rtrim, trim
Methods borrowed from class CKEDITOR.dom.domObject:
  equals, getCustomData, getPrivate, setCustomData
Methods borrowed from class CKEDITOR.event:
  fire, fireOnce, hasListeners, implementOn, on, removeListener

Class Detail
CKEDITOR.dom.text(text, ownerDocument)
Since: 3.0
Represents a DOM text node.

    var nativeNode = document.createTextNode( 'Example' );
    var text = CKEDITOR.dom.text( nativeNode );

    var text = CKEDITOR.dom.text( 'Example' );

Parameters:
{Object|String} text
  A native DOM text node or a string containing the text to use to create a new text node.
{CKEDITOR.dom.document} ownerDocument Optional
  The document that will contain the node in case of new node creation. Defaults to the current document.

Field Detail
{Object} $
Since: 3.0
The native DOM text node represented by this class instance.

    var element = new CKEDITOR.dom.text( 'Example' );
    alert( element.$.nodeType );  // "3"

{Number} type
Since: 3.0
The node type. This is a constant value set to CKEDITOR.NODE_TEXT.
Method Detail
{Undefined} getLength()
Since: 3.0

    NO EXAMPLE AVAILABLE

{Undefined} getText()
Since: 3.0

    NO EXAMPLE AVAILABLE

{CKEDITOR.dom.text} split(The)
Since: 3.0
Breaks this text node into two nodes at the specified offset, keeping both in the tree as siblings. This node then only contains all the content up to the offset point. A new text node, which is inserted as the next sibling of this node, contains all the content at and after the offset point. When the offset is equal to the length of this node, the new node has no data.

    NO EXAMPLE AVAILABLE

Parameters:
{Number} The
  position at which to split, starting from zero.

Returns:
  {CKEDITOR.dom.text} The new text node.

{Undefined} substring(indexA, indexB)
Since: 3.0
Extracts characters from indexA up to but not including indexB.

    NO EXAMPLE AVAILABLE

Parameters:
{Number} indexA
  An integer between 0 and one less than the length of the text.
{Number} indexB Optional
  An integer between 0 and the length of the string. If omitted, extracts characters to the end of the text.

Copyright © 2003-2009, CKSource - Frederico Knabben. All rights reserved.