X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_samples%2Fajax.html;h=499c09b88708573c018426bbf3f21438d4543e9c;hb=48b1db88210b4160dce439c6e3e32e14af8c106b;hp=0cd8ce8b68edd7778ea9ef35fd73cd4e1d0600c4;hpb=c6e377a02b54abc07129d72b632763c727476a15;p=ckeditor.git diff --git a/_samples/ajax.html b/_samples/ajax.html index 0cd8ce8..499c09b 100644 --- a/_samples/ajax.html +++ b/_samples/ajax.html @@ -1,11 +1,11 @@ - Ajax - CKEditor Sample + Ajax — CKEditor Sample @@ -22,22 +22,9 @@ function createEditor() var html = document.getElementById( 'editorcontents' ).innerHTML; - // Create a new editor inside the
- editor = CKEDITOR.appendTo( 'editor' ); - editor.setData( html ); - - // This sample may break here if the ckeditor_basic.js is used. In such case, the following code should be used instead: - /* - if ( editor.setData ) - editor.setData( html ); - else - { - CKEDITOR.on( 'loaded', function() - { - editor.setData( html ); - }); - } - */ + // Create a new editor inside the
, setting its value to html + var config = {}; + editor = CKEDITOR.appendTo( 'editor', config, html ); } function removeEditor() @@ -59,9 +46,20 @@ function removeEditor() -

- CKEditor Sample +

+ CKEditor Sample — Create and Destroy Editor Instances for Ajax Applications

+
+

+ This sample shows how to create and destroy CKEditor instances on the fly. After the removal of CKEditor the content created inside the editing + area will be displayed in a <div> element. +

+

+ For details of how to create this setup check the source code of this sample page + for JavaScript code responsible for the creation and destruction of a CKEditor instance. +

+
+
+

Click the buttons to create and remove a CKEditor instance.

@@ -89,10 +88,10 @@ function removeEditor()