读取和设置discuz发帖编辑器里面的内容

 更新时间:2016年5月19日 22:52  点击:1736
方法一:
switchEditor(0);
JQ("#e_textarea").val("这儿是编辑器的内容,不用直接用html代码");
discuzcode('svd');
switchEditor(1);




方法二:
$("#e_iframe").contents().find("body").html(“这儿可以在编辑器内部显示html代码”);


方法三:
newEditor(1,"e<hr>e中国<strong>xxxx</strong>e");  //直接解析html代码
newEditor(0,"e<hr>e中国<strong>xxxx</strong>e");  //不解析html代码


newEditor是discuz内置的编辑器函数,原型定义在/static/js/editor.js



在编写插件的时候,有可能会用得到。
 
[!--infotagslink--]

相关文章