Transferring data from an instance of a CKeditor window

I have a requirement when a user (when editing content in an instance of CKeditor) can click the preview button to show the page as it would with all the headers and logo, etc.

The user doesn't like the “preview” feature in CKeditor (which I thought would be sufficient), so I was hoping to open a new window and then get the values ​​from the CKeditor window through Javascript, however I am having a bit of trouble getting the text.

Does anyone know how a children's page can get this information?

Greetings in advance.

+3
source share
1 answer

, , :

var objEditor = window.opener.CKEDITOR.instances["body"];
           var q = objEditor.getData();

           document.getElementById('body').innerHTML = q;
+3

Source: https://habr.com/ru/post/1754617/


All Articles