Code Index | File Index

Namespaces

Classes


Class CKEDITOR.dom.document


Extends CKEDITOR.dom.domObject.

Defined in: core/dom/document.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
CKEDITOR.dom.document(domDocument)
Represents a DOM document.
Fields borrowed from class CKEDITOR.dom.domObject:
$
Method Summary
Method Attributes Method Name and Description
 
appendStyleSheet(cssFileUrl)
Appends a CSS file to the document.
 
createElement(name, attribsAndStyles)
 
createText(text)
 
Gets the <body> element for this document.
 
getById(elementId)
Gets and element based on its id.
 
Gets the <head> element for this document.
 
Gets the current selection from the document.
 
Gets the window object that holds this document.
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.document(domDocument)
Since: 3.0
Represents a DOM document.
var document = new CKEDITOR.dom.document( document );
Parameters:
{Object} domDocument
A native DOM document.
Method Detail
{Undefined} appendStyleSheet(cssFileUrl)
Since: 3.0
Appends a CSS file to the document.
CKEDITOR.document.appendStyleSheet( '/mystyles.css' );
Parameters:
{String} cssFileUrl
The CSS file URL.

{Undefined} createElement(name, attribsAndStyles)
Since: 3.0
NO EXAMPLE AVAILABLE
Parameters:
{Undefined} name
{Undefined} attribsAndStyles

{Undefined} createText(text)
Since: 3.0
NO EXAMPLE AVAILABLE
Parameters:
{Undefined} text

{CKEDITOR.dom.element} getBody()
Since: 3.0
Gets the <body> element for this document.
var element = CKEDITOR.document.getBody();
alert( element.getName() );  // "body"
Returns:
{CKEDITOR.dom.element} The <body> element.

{CKEDITOR.dom.element} getById(elementId)
Since: 3.0
Gets and element based on its id.
var element = CKEDITOR.document.getById( 'myElement' );
alert( element.getId() );  // "myElement"
Parameters:
{String} elementId
The element id.
Returns:
{CKEDITOR.dom.element} The element instance, or null if not found.

{CKEDITOR.dom.element} getHead()
Since: 3.0
Gets the <head> element for this document.
var element = CKEDITOR.document.getHead();
alert( element.getName() );  // "head"
Returns:
{CKEDITOR.dom.element} The <head> element.

{CKEDITOR.dom.selection} getSelection()
Since: 3.0
Gets the current selection from the document.
Defined in: plugins/selection/plugin.js.
var selection = CKEDITOR.instances.editor1.document.getSelection();
alert( selection.getType() );
Returns:
{CKEDITOR.dom.selection} A selection object.

{CKEDITOR.dom.window} getWindow()
Since: 3.0
Gets the window object that holds this document.
Returns:
{CKEDITOR.dom.window} The window object.

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