How Do I Read or Write the Contents of CKEditor from JavaScript?

This website contains links to software which is either no longer maintained or will be supported only until the end of 2019 (CKFinder 2). For the latest documentation about current CKSource projects, including software like CKEditor 4/CKEditor 5, CKFinder 3, Cloud Services, Letters, Accessibility Checker, please visit the new documentation website.

If you look for an information about very old versions of CKEditor, FCKeditor and CKFinder check also the CKEditor forum, which was closed in 2015. If not, please head to StackOverflow for support.

(Article contents added)
 
(Minor rewording)
 
Line 4: Line 4:
 
If you want to write some content into CKEditor, use the <code>[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html#setData setData(''data'', ''callback'')]</code> method.
 
If you want to write some content into CKEditor, use the <code>[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html#setData setData(''data'', ''callback'')]</code> method.
  
An example of how to use these functions can be found in the <code>api.html</code> sample file located in the <code>_samples</code> directory of CKEditor installation package.
+
An example of how to use these functions can be found in the '''Basic usage of the API''' sample (<code>api.html</code>) located in the <code>_samples</code> directory of CKEditor installation package.

Latest revision as of 14:10, 7 March 2011

If you want to read CKEditor contents, use the getData() method.

If you want to write some content into CKEditor, use the setData(data, callback) method.

An example of how to use these functions can be found in the Basic usage of the API sample (api.html) located in the _samples directory of CKEditor installation package.

This page was last edited on 7 March 2011, at 14:10.