JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.5.3
[ckeditor.git] / _samples / ajax.html
index 499c09b..c6fe892 100644 (file)
@@ -13,14 +13,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
        <script type="text/javascript">\r
        //<![CDATA[\r
 \r
-var editor;\r
+var editor, html = '';\r
 \r
 function createEditor()\r
 {\r
        if ( editor )\r
                return;\r
 \r
-       var html = document.getElementById( 'editorcontents' ).innerHTML;\r
 \r
        // Create a new editor inside the <div id="editor">, setting its value to html\r
        var config = {};\r
@@ -34,7 +33,7 @@ function removeEditor()
 \r
        // Retrieve the editor contents. In an Ajax application, this data would be\r
        // sent to the server or used in any other way.\r
-       document.getElementById( 'editorcontents' ).innerHTML = editor.getData();\r
+       document.getElementById( 'editorcontents' ).innerHTML = html = editor.getData();\r
        document.getElementById( 'contents' ).style.display = '';\r
 \r
        // Destroy the editor.\r