easyui有没有html编辑器,【easyui】kindeditor富文本(html编辑器)的使用
1.下載kindeditor
本人使用4.1.10版本百度云下載:點擊打開鏈接
2.放入項目中
3.我是用的jsp前臺網頁,(前臺為easyui)
在jsp中引入kindeditor的js和css樣式
4.kindeditor是根據textarea標簽,然后從js中根據id初始化此標簽使控件載入
a : 標簽
如果是使用easyui則
沒使用就
b: js初始化
注意name必須和textarea標簽的name id一致,才能使控件初始化
var?editor;
$(function()?{
editor?=?KindEditor.create('textarea[name="v_content"]',{resizeType?:?1,width:"100%",height:"200px",afterChange:function(){
this.sync();
},afterBlur:function(){
this.sync();
}});
});
c:如果只是讀取解析顯示html文檔可以這樣
var?editor;
$(function()?{
editor?=?KindEditor.create('textarea[name="v_notice_content"]',{resizeType?:?1,width:"100%",height:"200px"});
editor.readonly(true);
});
5.js中讀取和設置kindeditor富文本的值
a:讀取
var?mycontent=document.getElementById("v_content").value;
b:設置
注意dat.v_notice_content為后臺從數據庫返回來的
KindEditor.html('#v_notice_content',dat.v_notice_content);
總結
以上是生活随笔為你收集整理的easyui有没有html编辑器,【easyui】kindeditor富文本(html编辑器)的使用的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: html5option的js代码,ng-
- 下一篇: html返回滚动按钮,如何通过滚动显示按