JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-4.0.1_full
[ckeditor.git] / samples / appendto.html
1 <!DOCTYPE html>\r
2 <!--\r
3 Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.\r
4 For licensing, see LICENSE.html or http://ckeditor.com/license\r
5 -->\r
6 <html>\r
7 <head>\r
8         <title>CKEDITOR.appendTo &mdash; CKEditor Sample</title>\r
9         <meta charset="utf-8">\r
10         <script src="../ckeditor.js"></script>\r
11         <link rel="stylesheet" href="sample.css">\r
12 </head>\r
13 <body>\r
14         <h1 class="samples">\r
15                 <a href="index.html">CKEditor Samples</a> &raquo; Append To Page Element Using JavaScript Code\r
16         </h1>\r
17         <div id="section1">\r
18                 <div class="description">\r
19                         <p>\r
20                                 <code>CKEDITOR.appendTo</code> is basically to place editors\r
21                                 inside existing DOM elements. Unlike <code>CKEDITOR.replace</code>,\r
22                                 a target container to be replaced is no longer necessary. A new editor\r
23                                 instance is inserted directly wherever it is desired.\r
24                         </p>\r
25 <pre class="samples">CKEDITOR.appendTo( '<em>container_id</em>',\r
26         { /* Configuration options to be used. */ }\r
27         'Editor content to be used.'\r
28 );</pre>\r
29                 </div>\r
30                 <script>\r
31 \r
32                         // This call can be placed at any point after the\r
33                         // <textarea>, or inside a <head><script> in a\r
34                         // window.onload event handler.\r
35 \r
36                         // Replace the <textarea id="editor"> with an CKEditor\r
37                         // instance, using default configurations.\r
38                         CKEDITOR.appendTo( 'section1',\r
39                                 null,\r
40                                 '<p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p>'\r
41                         );\r
42 \r
43                 </script>\r
44         </div>\r
45         <br>\r
46         <div id="footer">\r
47                 <hr>\r
48                 <p>\r
49                         CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>\r
50                 </p>\r
51                 <p id="copy">\r
52                         Copyright &copy; 2003-2013, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico\r
53                         Knabben. All rights reserved.\r
54                 </p>\r
55         </div>\r
56 </body>\r
57 </html>\r