| 1 | <html> |
|---|
| 2 | |
|---|
| 3 | <head> |
|---|
| 4 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
|---|
| 5 | <title>CKEditor Test</title> |
|---|
| 6 | <script type="text/javascript" src="ckeditor/ckeditor.js"></script> |
|---|
| 7 | </head> |
|---|
| 8 | |
|---|
| 9 | <body> |
|---|
| 10 | |
|---|
| 11 | <textarea cols="80" id="editor1" name="editor1" rows="10">Editor 1</textarea> |
|---|
| 12 | <script type="text/javascript"> |
|---|
| 13 | var myEditor1 = CKEDITOR.replace( 'editor1', |
|---|
| 14 | { |
|---|
| 15 | toolbar : [ ['Bold', 'Italic', 'Underline'] ], |
|---|
| 16 | height: '100px', |
|---|
| 17 | removePlugins : 'maximize,resize' |
|---|
| 18 | } ); |
|---|
| 19 | </script> |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | <script type="text/javascript"> |
|---|
| 23 | GLOBAL_COUNTER = 1; |
|---|
| 24 | function OnButtonClick() |
|---|
| 25 | { |
|---|
| 26 | myEditor1.setData( 'Editor1 - ' + GLOBAL_COUNTER ); |
|---|
| 27 | myEditor1.resetDirty(); |
|---|
| 28 | |
|---|
| 29 | GLOBAL_COUNTER++; |
|---|
| 30 | } |
|---|
| 31 | </script> |
|---|
| 32 | <button onClick="OnButtonClick()">setData and resetDirty</button> |
|---|
| 33 | </body> |
|---|
| 34 | </html> |
|---|