富文编辑器使用,Ueditor后端配置项没有正常加载,上传插件不能正常使用! |
您所在的位置:网站首页 › 上传插件不能正常使用 › 富文编辑器使用,Ueditor后端配置项没有正常加载,上传插件不能正常使用! |
一、使用(我这里使用的是jsp版本的富文本编辑器) 1) 下载ueditor 下载地址:http://ueditor.baidu.com/website/download.html 2) 解压缩文件,并把文件夹名改为ueditor ueditor\jsp\lib路径下有commons-codec-1.9.jar、commons-fileupload-1.3.1.jar、commons-io-2.4.jar、json.jar、ueditor-1.1.2.jar五个jar包 3) 把整个ueditor文件夹复制到工程WebRoot下; 把ueditor\jsp\lib文件夹下的五个jar包复制到WebRoot—>WEB-INF—>lib文件夹下(我就是放错了文件夹,导致编辑器可以使用,但是无法使用图片上传功能) 4) 在jsp文件中先引入ueditor.config.js、ueditor.all.js文件
5) 页面中这么使用 这里写你的初始化内容 var ue = UE.getEditor('container'); 6) 效果图
7) 设置和读取编辑器的内容 var ue = UE.getContent(); //对编辑器的操作最好在编辑器ready之后再做 ue.ready(function() { //设置编辑器的内容 ue.setContent('hello'); //获取html内容,返回: hello var html = ue.getContent(); //获取纯文本内容,返回: hello var txt = ue.getContentTxt(); }); |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |