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 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
精彩评论