JavaScript
var preview = CKEDITOR.document.getById( 'mailViewer' );
preview.setHtml($('#mail-content').html());
HTML
<span id="mail-content" th:text="${mailReceived.body}" style="display:none;"></span>
<div id="mailViewer"></div>
我试图在CKEDITOR中设置HTML字符串,但它没有显示HTML预览。如何让它显示html预览
答案 0 :(得分:0)
如果我理解你的问题是正确的,你应该这样做
CKEDITOR.instances['mailViewer'].setData($('#mail-content').html())