Using jQuery to grab the content from CKEditor's iframe Using jQuery to grab the content from CKEditor's iframe ajax ajax

Using jQuery to grab the content from CKEditor's iframe


Another generic solutions to this would be to run the following whenever you try to submit the form

for ( instance in CKEDITOR.instances )            CKEDITOR.instances[instance].updateElement();

This will force all CKEDITOR instances in the form to update their respective fields


I've just released a CKEditor plugin for jQuery which will take care of all this in the background without any extra code:http://www.fyneworks.com/jquery/CKEditor/


I have also been trying to fix this problem today. I realised that the reason the above code isnt working for me is because the CKEditor instance isnt ready yet when the document property is referenced. So you have to call the "instanceReady" event and within that the document's events can be used, because prior to that it just doesnt exist.

This example might work for you:

CKEDITOR.instances["editor1"].on("instanceReady", function(){//set keyup eventthis.document.on("keyup", CK_jQ); //and paste eventthis.document.on("paste", CK_jQ);});function CK_jQ(){    CKEDITOR.tools.setTimeout( function()    {         $("#editor1").val(CKEDITOR.instances.editor1.getData());     }, 0);}