Class CKEDITOR.dom.document
Extends
CKEDITOR.dom.domObject.
Defined in: core/dom/document.js.
Constructor Attributes | Constructor Name and Description |
---|---|
CKEDITOR.dom.document(domDocument)
Represents a DOM document.
|
- Fields borrowed from class CKEDITOR.dom.domObject:
- $, removeCustomData
Method Attributes | Method Name and Description |
---|---|
appendStyleSheet(cssFileUrl)
Appends a CSS file to the document.
|
|
appendStyleText(cssStyleText)
|
|
createElement(name, attribsAndStyles)
|
|
createText(text)
|
|
focus()
|
|
getBody()
Gets the <body> element for this document.
|
|
getByAddress(address, normalized)
|
|
getById(elementId)
Gets and element based on its id.
|
|
Gets the DOM document element for this document.
|
|
getElementsByTag(tagName, namespace)
|
|
getHead()
Gets the <head> element for this document.
|
|
Gets the current selection from the document.
|
|
Gets the window object that holds this document.
|
|
write(html)
Defines the document contents through document.write.
|
- Methods borrowed from class CKEDITOR.dom.domObject:
- clearCustomData, equals, getCustomData, getPrivate, getUniqueId, removeAllListeners, setCustomData
- Methods borrowed from class CKEDITOR.event:
- fire, fireOnce, hasListeners, 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}
appendStyleText(cssStyleText)
Since:
3.0
NO EXAMPLE AVAILABLE
- Parameters:
- {Undefined} cssStyleText
{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
{Undefined}
focus()
Since:
3.0
NO EXAMPLE AVAILABLE
{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.
{Undefined}
getByAddress(address, normalized)
Since:
3.0
NO EXAMPLE AVAILABLE
- Parameters:
- {Undefined} address
- {Undefined} normalized
{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}
getDocumentElement()
Since:
3.0
Gets the DOM document element for this document.
NO EXAMPLE AVAILABLE
- Returns:
- {CKEDITOR.dom.element} The DOM document element.
{Undefined}
getElementsByTag(tagName, namespace)
Since:
3.0
NO EXAMPLE AVAILABLE
- Parameters:
- {Undefined} tagName
- {Undefined} namespace
{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.
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.
NO EXAMPLE AVAILABLE
- Returns:
- {CKEDITOR.dom.window} The window object.
{Undefined}
write(html)
Since:
3.5
Defines the document contents through document.write. Note that the
previous document contents will be lost (cleaned).
document.write( '<html>' + '<head><title>Sample Doc</title></head>' + '<body>Document contents created by code</body>' + '</html>' );
- Parameters:
- {String} html
- The HTML defining the document contents.