javascript - How to get the contents of ckeditor on change? -


i have following code detecting changes on ckeditor surface.

ckeditor.instances['editor1'].on("instanceready", function(){                     this.document.on("keyup", function(){ console.log("sth changed"); }); }); 

i contents of editor on change counting words in it. how can reach using ckeditor.instances?

the only correct way retrieve contents of editor is:

ckeditor.instances.yourinstancename.getdata(); 

you can try this.on( 'key', function() { ... } ); because editor fires key events.

additionally recommend the ticket regarding onchange event , monitoring changes in editor.

and last not least: the wordcount plugin has been implemented , job ;)


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -