富文本编辑器 WangEditor的使用
1.首先引入jar ---------------wangEditor.js
2.初始化wangEditor
var E = window.wangEditor
editor = new E('#notContect')
editor.customConfig.uploadImgServer = 'p/onload/upload'; //上传URL
editor.customConfig.uploadFileName = 'myFileName';
editor.customConfig.uploadImgHooks = {
customInsert: function (insertImg, result, editor) {
//上传成功后返回地址
var url =result.data;
insertImg(url);
// result 必须是一个 JSON 格式字符串!!!否则报错
}
}
editor.create();
附上wangEditor官网地址---http://www.wangeditor.com/