test Blog
Retrieving Data from CKEditor 4 Some applications need to handle all data on the client side, sending it to the server using their specific methods. This is what usually happens in inline editing — with the possibility to create and destroy CKEditor 4 instances dynamically, CKEditor 4 is a perfect match for Ajax applications. If this is the case, it is enough to use the JavaScript API methods to easily retrieve the editor instance data. To retrieve the editor data, call the CKEDITOR.editor.getData method of the editor instance. For an editor instance with an ID of editor1, this would look like the following: <script> var data = CKEDITOR.instances.editor1.getData(); // Your code to save "data", usually through Ajax. </script> If you do not save your data with a library that already encodes it by using the JavaScript encodeURIComponent method, but do it manually instead, you will have to remember to use encodeURIComponent to properly encode the data that is being sent. Note that the ID of the original element that is replaced with CKEditor was passed to the instances object to make it possible to retrieve the editor instance.