zoukankan      html  css  js  c++  java
  • UEditor用法

    UEditor百度是咋回事,界面美观,强大,用起来还不错。

    看到此链接http://ueditor.baidu.com/

    一、下载

    http://ueditor.baidu.com/download.html

    二、部署

    眼下最新版本号为1.1.7.3

    下载下来的文件名称为ueditor1.1.7.3.zip

    把解压出来的ueditor目录整个拷贝到项目WebRoot下

    1.页面<head>里添加下面代码

    <script type="text/javascript" charset="utf-8" src="ueditor/editor_config.js"></script>
    <script type="text/javascript" charset="utf-8" src="ueditor/editor_all.js"></script>
    <link rel="stylesheet" type="text/css" href="ueditor/themes/default/ueditor.css"/>
    2.页面<body>里添加下面代码
    <div id="newscontent"></div>
    <script type="text/javascript">
    	var editor = new baidu.editor.ui.Editor();
    	editor.render('newscontent');
    </script>
    打开浏览器,输入对应地址。一个美丽的编辑器就出现了,但表情和上传文件这块还须要更改一下配置

    三、改动配置,添加上传

    打开editor_config.js文件,改动URL的值

    var URL= "ueditor/";
    保存,刷新一下页面,表情是不是能够出来了?

    文件上传默认用的是ueditor/server/upload/php/up.php进行上传的。假设用jsp上传,须要改动两个地方

    1.改动ueditor/dialogs/image/image.html页面里第304行和ueditor/dialogs/wordimage/wordimage.html页面第82行。改为使用up.jsp进行上传,这里面用的是apache的fileupload组件,所以要导入apache commons组件中的fileupload和io这两个jar包

    url:'../../server/upload/jsp/up.jsp',

    2.改动ueditor/server/jsp/up.jsp。指定文件的保存路径

    //保存文件路径
    String filePath = "uploadfiles";
    String realPath = "D:\apache-tomcat-6.0.26\webapps\test\"+filePath;
    所以一切OK该,刷新测试!




  • 相关阅读:
    Single Threaded Execution
    多线程(第三天)
    多线程(第二天)
    IE中float:right单独一行
    web.xml配置
    java调用asmx的webservice
    跨域访问
    jsp页面导入jstl标签
    搜索dwr做即时聊天的时候看到的问题
    LigerUI tree在ie下显示不出来/LigerUI 控件在ie下错乱
  • 原文地址:https://www.cnblogs.com/yxwkf/p/4592869.html
Copyright © 2011-2022 走看看