KindEditor 富文本框 文件上传,图片上传

<textarea rows="3" style="width:400px;" id="zw" name="zw" class="easyui-validatebox" data-options="required:true,validType:'length[1,1000000]'" invalidMessage="最大长度不能超过1000000"></textarea>

//jsp页面引入

<script type="text/javascript" src="${request.contextPath}/kindeditor/kindeditor-min.js"></script>

<scriptcharset="utf-8"    src="${request.contextPath}/kindeditor/lang/zh_CN.js"></script>


 $(function() {  
          editor = KindEditor.create('textarea[name="zw"]',{//和neme 相同
          allowImageUpload:true,//允许上传图片
          allowFileManager:true, //允许对上传图片进行管理

          uploadJson:'${request.contextPath}/kindeditor/jsp/upload_json.jsp', //上传图片的java代码添加时的路径

        //fileManagerJson:'${request.contextPath}/kindeditor/jsp/file_manager_json.jsp',//编辑是加进去

        items : [

                    'fontname','fontsize', '|','forecolor', 'hilitecolor','bold', 'italic','underline',
                    'removeformat','|', 'justifyleft','justifycenter', 'justifyright','insertorderedlist',
                    'insertunorderedlist','|', 'emoticons','link','|','image','insertfile'],
          resizeType : 1,width:"100%",height:"200px",afterChange:function(){  
              this.sync();  
           },afterBlur:function(){  
               this.sync();  
           }});  

    });  

//修改upload_json.jsp

String savePath = pageContext.getServletContext().getRealPath("/") + "/kindeditor/";

String saveUrl  = request.getContextPath() + "/kindeditor/";

//修改file_manager_json.jsp

String rootPath = pageContext.getServletContext().getRealPath("/") + "/kindeditor/";

String rootUrl  = request.getContextPath() + "/kindeditor/";

//需要一个 下载json-simple-1.1.1.jar包

json-simple-1.1.1.jar


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值