CKEDITOR, is return some strange characters

Posted by nobosh on Stack Overflow See other posts from Stack Overflow or by nobosh
Published on 2010-06-06T01:09:03Z Indexed on 2010/06/06 1:12 UTC
Read the original article Hit count: 259

Filed under:

With CKEDITOR, when I use JS to get the contents of the Text Editor, I'm getting back:

<p>\u000a\u0009&nbsp;ad adad ad asd</p>\u000a

When I should have gotten:

<p>ad adad ad asd</p>

Any idea what's going on here?

The only difference that could be the cause is that I'm dynamically created textareas on load, and using a class to find the editor:

$('.guideItem-textarea').each(function(index, value){
    // ID of the textarea
    var targeteditor = $(this).attr('id');
    var targeteditorID = $(this).attr('id').replace('noteguide','');

    // Contents in the editor
    textareacontents = CKEDITOR.instances[targeteditor].getData();
});

Any ideas?

© Stack Overflow or respective owner

Related posts about ckeditor