| 1 | <!DOCTYPE html> |
|---|
| 2 | <html> |
|---|
| 3 | <head> |
|---|
| 4 | <meta charset="utf-8"> |
|---|
| 5 | <title>A Simple Page with CKEditor</title> |
|---|
| 6 | <script src="../ckeditor.js"></script> |
|---|
| 7 | </head> |
|---|
| 8 | <body> |
|---|
| 9 | <button id="myFirstButton" onclick="insertImage();" >Click Me</button> |
|---|
| 10 | <button id="mySecondButton" onclick="alertData();">And Then Click Me</button> |
|---|
| 11 | <form> |
|---|
| 12 | <textarea name="editor1" id="editor1" rows="10" cols="80"></textarea> |
|---|
| 13 | <script> |
|---|
| 14 | var editor = CKEDITOR.replace( 'editor1', {extraPlugins:'divarea'} ); |
|---|
| 15 | |
|---|
| 16 | function insertImage(){ |
|---|
| 17 | editor.insertHtml('<img src="http://c.cksource.com/a/5/img/sprites.png" />' ); |
|---|
| 18 | } |
|---|
| 19 | |
|---|
| 20 | function alertData(){ |
|---|
| 21 | alert( editor.getData() ); |
|---|
| 22 | } |
|---|
| 23 | </script> |
|---|
| 24 | <button type="submit">Submit</button> |
|---|
| 25 | </form> |
|---|
| 26 | </body> |
|---|
| 27 | </html> |
|---|