我想在CKEditor中编辑格式化的HTML,但问题是如果我动态设置值,那么它只能在“SOURCE”模式下查看,它显示为空白!
我用过
<textarea name="text2" id="text2"><?php echo $text; ?></textarea>
var str=document.getElementById('text2').value;
CKEDITOR.instances.text.setData(str);
和
CKEDITOR.instances.text.setData('<?php echo htmlentities($HTMLcode, ENT_QUOTES); ?>');
我尝试过的示例数据
<h3 style="color:blue;">
<!-- T<strong>his </strong>webs<sup>ite a</sup>nd its conten<em>t is cop</em>yright<u> of </u><span style="color:#ff0000;">Sourav Ghosh 2011</span>.All rights <sub>reserved.Any redistribution or reproduction of part or all of the contents in any form is prohibited</sub>.This work is registered under Section 2 (o) of the Indian Copyright Act, 1957. For more you can visit <span style="font-size:36px;"><strong><u><span style="background-color:#ffff00;">http://copyright.gov.in</span></u></strong></span> --></h3>
遇到问题,这里是恶棍字符串
<!--
甚至这个
<!--
但是如何在CKEditor中设置包含上述任何字符串的数据?