You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.8 KiB

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