| 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>Replace Textarea by Code — CKEditor Sample</title> |
|---|
| 9 | <meta charset="utf-8"> |
|---|
| 10 | <script src="../ckeditor.js"></script> |
|---|
| 11 | <link href="sample.css" rel="stylesheet"> |
|---|
| 12 | </head> |
|---|
| 13 | <body> |
|---|
| 14 | <h1 class="samples"> |
|---|
| 15 | <a href="index.html">CKEditor Samples</a> » Replace Textarea Elements Using JavaScript Code |
|---|
| 16 | </h1> |
|---|
| 17 | <form action="sample_posteddata.php" method="post"> |
|---|
| 18 | <div class="description"> |
|---|
| 19 | <p> |
|---|
| 20 | This editor is using an <code><iframe></code> element-based editing area, provided by the <strong>Wysiwygarea</strong> plugin. |
|---|
| 21 | </p> |
|---|
| 22 | <pre class="samples"> |
|---|
| 23 | CKEDITOR.replace( '<em>textarea_id</em>' ) |
|---|
| 24 | </pre> |
|---|
| 25 | </div> |
|---|
| 26 | <textarea cols="80" id="editor1" name="editor1" rows="10"> |
|---|
| 27 | <p>bla blabla <img alt="" style="width: 139px; height: 36px;" src="http://i.msdn.microsoft.com/dynimg/IC600833.png" title="test double quote "test" test">bla bla bla</p> |
|---|
| 28 | </textarea> |
|---|
| 29 | <script> |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | // This call can be placed at any point after the |
|---|
| 33 | // <textarea>, or inside a <head><script> in a |
|---|
| 34 | // window.onload event handler. |
|---|
| 35 | |
|---|
| 36 | // Replace the <textarea id="editor"> with an CKEditor |
|---|
| 37 | // instance, using default configurations. |
|---|
| 38 | |
|---|
| 39 | CKEDITOR.replace( 'editor1' ); |
|---|
| 40 | |
|---|
| 41 | </script> |
|---|
| 42 | <p> |
|---|
| 43 | <input type="submit" value="Submit"> |
|---|
| 44 | </p> |
|---|
| 45 | </form> |
|---|
| 46 | <div id="footer"> |
|---|
| 47 | <hr> |
|---|
| 48 | <p> |
|---|
| 49 | CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a> |
|---|
| 50 | </p> |
|---|
| 51 | <p id="copy"> |
|---|
| 52 | Copyright © 2003-2013, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico |
|---|
| 53 | Knabben. All rights reserved. |
|---|
| 54 | </p> |
|---|
| 55 | </div> |
|---|
| 56 | </body> |
|---|
| 57 | </html> |
|---|