views:

21

answers:

1

Hi,

I have a requirement where a user (while editing the content in a CKeditor instance) can click a preview button to show the page as it would be with all the headers and logo's etc.

The user doesn't like the 'preview' function in CKeditor (which I thought would be adequate), so I was hoping to open the new window and then retrieve the values from the CKeditor window via Javascript, however i'm having a little trouble getting the text.

Does anyone know how the child page can get this info?

Cheers in advance.

+1  A: 

Hi guys,

I think i have answered it myself, use the below:

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

           document.getElementById('body').innerHTML = q;
mailman1979