Ticket #3812: replacebycode.html

File replacebycode.html, 3.7 KB (added by Senthil, 15 years ago)
Line 
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">&lt;p&gt;AJAX DATA &lt;/p&gt;</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">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://www.fckeditor.net/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</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&lt;form action=""&gt;
76  &lt;p&gt;
77    &lt;label for="editor1"&gt;
78      Editor 1:&lt;/label&gt;&lt;br /&gt;
79    &lt;textarea <b>name="editor1"</b> rows="10" cols="80"&gt;&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://www.fckeditor.net/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;&lt;/textarea&gt;
80    &lt;script type="text/javascript"&gt;
81    //&lt;![CDATA[
82
83      <b>CKEDITOR.replace( 'editor1' );</b>
84
85    //]]&gt;
86    &lt;/script&gt;
87  &lt;/p&gt;
88  &lt;p&gt;
89    &lt;input type="submit" value="Submit" /&gt;
90  &lt;/p&gt;
91&lt;/form&gt;
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>
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy