| 1 | <html xmlns="http://www.w3.org/1999/xhtml"> |
|---|
| 2 | <head> |
|---|
| 3 | <title>Sample - CKEditor</title> |
|---|
| 4 | <meta content="text/html; charset=utf-8" http-equiv="content-type"/> |
|---|
| 5 | <script type="text/javascript" src="../ckeditor.js"></script> |
|---|
| 6 | <script src="sample.js" type="text/javascript"></script> |
|---|
| 7 | <link href="sample.css" rel="stylesheet" type="text/css"/> |
|---|
| 8 | |
|---|
| 9 | <SCRIPT> |
|---|
| 10 | AjaxReq = function () |
|---|
| 11 | { |
|---|
| 12 | var result ='<label for="editor1">Editor 1:</label><br/><textarea cols="80" id="editor1" name="editor1" rows="10"><p>AJAX DATA </p></textarea>'; |
|---|
| 13 | document.getElementById('editorcontent').innerHTML = result; |
|---|
| 14 | var script = document.createElement("script"); |
|---|
| 15 | var dscript="CKEDITOR.replace('editor1');CKEDITOR.instances['editor1'].setData('<p>Do you see the problem..!!!</p>');CKEDITOR.on( 'instanceReady', function( ev ){alert('instance Ready');});"; |
|---|
| 16 | |
|---|
| 17 | script.setAttribute("type","text/javascript") |
|---|
| 18 | script.setAttribute("id",'sId'); |
|---|
| 19 | script.text = dscript; |
|---|
| 20 | |
|---|
| 21 | var head = document.getElementsByTagName("head")[0]; |
|---|
| 22 | head.appendChild(script); |
|---|
| 23 | } |
|---|
| 24 | |
|---|
| 25 | </SCRIPT> |
|---|
| 26 | </head> |
|---|
| 27 | <body> |
|---|
| 28 | <h1> |
|---|
| 29 | CKEditor Sample |
|---|
| 30 | </h1> |
|---|
| 31 | <!-- This <div> holds alert messages to be display in the sample page. --> |
|---|
| 32 | <div id="alerts"> |
|---|
| 33 | <noscript> |
|---|
| 34 | <p> |
|---|
| 35 | <strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript |
|---|
| 36 | support, like yours, you should still see the contents (HTML data) and you should |
|---|
| 37 | be able to edit it normally, without a rich editor interface. |
|---|
| 38 | </p> |
|---|
| 39 | </noscript> |
|---|
| 40 | </div> |
|---|
| 41 | <!-- This <fieldset> holds the HTML that you will usually find in your |
|---|
| 42 | pages. --> |
|---|
| 43 | <fieldset title="Output"> |
|---|
| 44 | <legend>Output</legend> |
|---|
| 45 | <form action="sample_posteddata.php" method="post"> |
|---|
| 46 | <p><div id="editorcontent"> |
|---|
| 47 | <label for="editor1"> |
|---|
| 48 | Editor 1:</label><br/> |
|---|
| 49 | <textarea cols="80" id="editor1" name="editor1" rows="10"><p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">CKEditor</a>.</p></textarea></div> |
|---|
| 50 | <script type="text/javascript"> |
|---|
| 51 | //<![CDATA[ |
|---|
| 52 | |
|---|
| 53 | // This call can be placed at any point after the |
|---|
| 54 | // <textarea>, or inside a <head><script> in a |
|---|
| 55 | // window.onload event handler. |
|---|
| 56 | |
|---|
| 57 | // Replace the <textarea id="editor"> with an CKEditor |
|---|
| 58 | // instance, using default configurations. |
|---|
| 59 | CKEDITOR.replace( 'editor1' ); |
|---|
| 60 | |
|---|
| 61 | //]]> |
|---|
| 62 | </script> |
|---|
| 63 | </p> |
|---|
| 64 | |
|---|
| 65 | <p> |
|---|
| 66 | <input type="button" value="Click me for multiple times to see the issue" onclick='javascript:AjaxReq();'/> |
|---|
| 67 | </p> |
|---|
| 68 | </form> |
|---|
| 69 | </fieldset> |
|---|
| 70 | <!-- This <fieldset> contains the output readable code that illustrates |
|---|
| 71 | how to use the editor, having the results shown in this sample. --> |
|---|
| 72 | <fieldset title="Code"> |
|---|
| 73 | <legend>Code</legend> |
|---|
| 74 | <pre> |
|---|
| 75 | <form action=""> |
|---|
| 76 | <p> |
|---|
| 77 | <label for="editor1"> |
|---|
| 78 | Editor 1:</label><br /> |
|---|
| 79 | <textarea <b>name="editor1"</b> rows="10" cols="80"><p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">CKEditor</a>.</p></textarea> |
|---|
| 80 | <script type="text/javascript"> |
|---|
| 81 | //<![CDATA[ |
|---|
| 82 | |
|---|
| 83 | <b>CKEDITOR.replace( 'editor1' );</b> |
|---|
| 84 | |
|---|
| 85 | //]]> |
|---|
| 86 | </script> |
|---|
| 87 | </p> |
|---|
| 88 | <p> |
|---|
| 89 | <input type="submit" value="Submit" /> |
|---|
| 90 | </p> |
|---|
| 91 | </form> |
|---|
| 92 | </pre> |
|---|
| 93 | </fieldset> |
|---|
| 94 | <div id="footer"> |
|---|
| 95 | <hr/> |
|---|
| 96 | <p> |
|---|
| 97 | CKEditor - The text editor for Internet - <a href="http://ckeditor.com/" shape="rect">http://ckeditor.com</a> |
|---|
| 98 | </p> |
|---|
| 99 | <p id="copy"> |
|---|
| 100 | Copyright © 2003-2009, <a href="http://cksource.com/" shape="rect">CKSource</a> - Frederico Knabben. All rights reserved. |
|---|
| 101 | </p> |
|---|
| 102 | </div> |
|---|
| 103 | </body> |
|---|
| 104 | </html> |
|---|