Gokul p Gokul p - 1 year ago 127
Javascript Question

ckeditor plugin functionality not working after using setData("hai");

I'm using the ck-editor(4.4.6). In Ck-editor's textarea I want to update my text, for that I use setData("hai"); that text updating correctly but some plugin functionality not working after use this setData(); (eg. restrict multiple enter if I reload the page it's working correctly).

editorInstance.setData("test text");

Anyway first time and after reload the page it working fine.

ruby on rails with jquery things are I'm using.

If anyone know any-other way to solve this pls share with me. Thanks.

Answer Source

Finally, I got the answer instead of set data I just add my content to CKEditor textarea as link this its working fine $('#cke_editor1 iframe').contents().find('body').html("Your text");