1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
\r
3 Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
\r
4 For licensing, see LICENSE.html or http://ckeditor.com/license
\r
6 <html xmlns="http://www.w3.org/1999/xhtml">
\r
8 <title>Ajax - CKEditor Sample</title>
\r
9 <meta content="text/html; charset=utf-8" http-equiv="content-type" />
\r
10 <script type="text/javascript" src="../ckeditor.js"></script>
\r
11 <script src="sample.js" type="text/javascript"></script>
\r
12 <link href="sample.css" rel="stylesheet" type="text/css" />
\r
13 <script type="text/javascript">
\r
18 function createEditor()
\r
23 var html = document.getElementById( 'editorcontents' ).innerHTML;
\r
25 // Create a new editor inside the <div id="editor">, setting its value to html
\r
27 editor = CKEDITOR.appendTo( 'editor', config, html );
\r
30 function removeEditor()
\r
35 // Retrieve the editor contents. In an Ajax application, this data would be
\r
36 // sent to the server or used in any other way.
\r
37 document.getElementById( 'editorcontents' ).innerHTML = editor.getData();
\r
38 document.getElementById( 'contents' ).style.display = '';
\r
40 // Destroy the editor.
\r
52 <!-- This <div> holds alert messages to be display in the sample page. -->
\r
56 <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
\r
57 support, like yours, you should still see the contents (HTML data) and you should
\r
58 be able to edit it normally, without a rich editor interface.
\r
63 <input onclick="createEditor();" type="button" value="Create Editor" />
\r
64 <input onclick="removeEditor();" type="button" value="Remove Editor" />
\r
66 <!-- This div will hold the editor. -->
\r
69 <div id="contents" style="display: none">
\r
71 Edited Contents:</p>
\r
72 <!-- This div will be used to display the editor contents. -->
\r
73 <div id="editorcontents">
\r
79 CKEditor - The text editor for Internet - <a href="http://ckeditor.com/">http://ckeditor.com</a>
\r
82 Copyright © 2003-2010, <a href="http://cksource.com/">CKSource</a> - Frederico
\r
83 Knabben. All rights reserved.
\r