JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
59b0f81d6b7804952a8f9911fcfb91c9d0b77258
[ckeditor.git] / samples / appendto.html
1 <!DOCTYPE html>\r
2 <!--\r
3 Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.\r
4 For licensing, see LICENSE.md or http://ckeditor.com/license\r
5 -->\r
6 <html>\r
7 <head>\r
8         <meta charset="utf-8">\r
9         <title>Append To Page Element Using JavaScript Code &mdash; CKEditor Sample</title>\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                                 The <code><a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR-method-appendTo">CKEDITOR.appendTo()</a></code> method serves to to place editors inside existing DOM elements. Unlike <code><a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR-method-replace">CKEDITOR.replace()</a></code>,\r
21                                 a target container to be replaced is no longer necessary. A new editor\r
22                                 instance is inserted directly wherever it is desired.\r
23                         </p>\r
24 <pre class="samples">CKEDITOR.appendTo( '<em>container_id</em>',\r
25         { /* Configuration options to be used. */ }\r
26         'Editor content to be used.'\r
27 );</pre>\r
28                 </div>\r
29                 <script>\r
30 \r
31                         // This call can be placed at any point after the\r
32                         // DOM element to append CKEditor to or inside the <head><script>\r
33                         // in a window.onload event handler.\r
34 \r
35                         // Append a CKEditor instance using the default configuration and the\r
36                         // provided content to the <div> element of ID "section1".\r
37                         CKEDITOR.appendTo( 'section1',\r
38                                 null,\r
39                                 '<p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p>'\r
40                         );\r
41 \r
42                 </script>\r
43         </div>\r
44         <br>\r
45         <div id="footer">\r
46                 <hr>\r
47                 <p>\r
48                         CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>\r
49                 </p>\r
50                 <p id="copy">\r
51                         Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico\r
52                         Knabben. All rights reserved.\r
53                 </p>\r
54         </div>\r
55 </body>\r
56 </html>\r