3 Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
\r
4 For licensing, see LICENSE.md or http://ckeditor.com/license
\r
8 <meta charset="utf-8">
\r
9 <title>Ajax — CKEditor Sample</title>
\r
10 <script src="../../ckeditor.js"></script>
\r
11 <link rel="stylesheet" href="sample.css">
\r
14 var editor, html = '';
\r
16 function createEditor() {
\r
20 // Create a new editor inside the <div id="editor">, setting its value to html
\r
22 editor = CKEDITOR.appendTo( 'editor', config, html );
\r
25 function removeEditor() {
\r
29 // Retrieve the editor contents. In an Ajax application, this data would be
\r
30 // sent to the server or used in any other way.
\r
31 document.getElementById( 'editorcontents' ).innerHTML = html = editor.getData();
\r
32 document.getElementById( 'contents' ).style.display = '';
\r
34 // Destroy the editor.
\r
42 <h1 class="samples">
\r
43 <a href="index.html">CKEditor Samples</a> » Create and Destroy Editor Instances for Ajax Applications
\r
45 <div class="warning deprecated">
\r
46 This sample is not maintained anymore. Check out its <a href="http://sdk.ckeditor.com/samples/saveajax.html">brand new version in CKEditor SDK</a>.
\r
48 <div class="description">
\r
50 This sample shows how to create and destroy CKEditor instances on the fly. After the removal of CKEditor the content created inside the editing
\r
51 area will be displayed in a <code><div></code> element.
\r
54 For details of how to create this setup check the source code of this sample page
\r
55 for JavaScript code responsible for the creation and destruction of a CKEditor instance.
\r
58 <p>Click the buttons to create and remove a CKEditor instance.</p>
\r
60 <input onclick="createEditor();" type="button" value="Create Editor">
\r
61 <input onclick="removeEditor();" type="button" value="Remove Editor">
\r
63 <!-- This div will hold the editor. -->
\r
66 <div id="contents" style="display: none">
\r
70 <!-- This div will be used to display the editor contents. -->
\r
71 <div id="editorcontents">
\r
77 CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
\r
80 Copyright © 2003-2017, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
\r
81 Knabben. All rights reserved.
\r