开发者

CKEDITOR, is return some strange characters

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开发者_JS百科 the editor
    textareacontents = CKEDITOR.instances[targeteditor].getData();
});

Any ideas?


Those strange characters are unicode control characters. The first one is a line feed, the seond is a tab. is the data in your example really the values in your question? Perhaps your prepopulated the text from some other source?

Suggested reading after you figure this out though: http://www.joelonsoftware.com/articles/Unicode.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜