My problem is that I am using the CKEditor 3.4 plugin for jQuery and this gives me an error in IE 7 + 8 when making a call to $ (selector) .val (html) in the editor:
Error: 'this. $. innerHTML 'is null or not an object
... which, when launched in the debugger, points to this line of code in the huge CKEditor.js:
getHtml:function(){var i=this.$.innerHTML;return c?i.replace(/<\?[^>]*>/g,''):i;}
... which corresponds to this in the source:
getHtml : function() { var retval = this.$.innerHTML;
My violation code (truncated but still throwing an error):
var editor_data = $("textarea#body").val(); $("textarea#body").val(editor_data);
... and the textarea code for posterity:
<textarea name="body" rows="15" cols="50" class="wysiwyg" id="body"></textarea>
I tried to play in jsFiddle in IE8, but it is strange that it works as intended. I would also like to provide a working sample, but, unfortunately, I canβt for reasons beyond my control.
I also tried this fix and it fixed the problem with the error, but after that setData did not work properly and just rewrote the contents of the editor with nothing. I admit that this problem + fix is ββa little over my head ...: http://dev.ckeditor.com/ticket/4566
(Sorry, long post: S) I also tried using the direct JavaScript API in CKEditor (abandon jQuery integration) and it threw the same error.
Anyone have anything that they would like me to try to fix this problem or have any problems? It would be very grateful!
javascript jquery dom ckeditor
mmoriar1
source share