开发者

Passing data from CKeditor window instance

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.


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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜