使用富文本編輯器Kindeditor
阿新 • • 發佈:2019-02-27
文本 tor type 需要 復制 富文本編輯 ready 決定 文本框
今天在做需求的時候,遇到有一個字段,需要保存帶有格式的內容,決定使用富文本框編輯器Kindeditor來實現,解決方法如下:
登錄官網下載控件包: http://kindeditor.net/down.php
下載後解壓,把解壓到的文件夾整個復制到項目裏面,
然後,在需要用這個控件的頁面這樣引用它:<script src="../../kindeditor/kindeditor-all.js" type="text/javascript" />
然後在頁面<body></body>後面加上這一段
<script type="text/javascript">
KindEditor.ready(function(K){
var editor1=K.create(‘#txtRules‘,{
afterChange:function(){
var self=this;
self.sync();
}
});
});
</script>
使用富文本編輯器Kindeditor