zoukankan      html  css  js  c++  java
  • ueditor使用注意事项

    1、js问题的介绍

          第一ueditor型材

    <script type="text/javascript" src="ueditor1_4_3-utf8-jsp/ueditor.config.js"></script>
    <script type="text/javascript" src="ueditor1_4_3-utf8-jsp/ueditor.all.min.js"></script>

    2、表单提交获取值的问题

      ${param.content }
      <form action="ueditor.jsp" method="post">
      <script id="container" name="content" type="text/plain">
        </script>
        
          <script type="text/javascript">
            var ue = UE.getEditor('container');
        </script>
        <input type="submit" value="提交">
        </form>

    当中name若是没写的话默认的是editorValue。能够在ueditor.config,js中改动

    若写了name的属性就会自己主动覆盖原来的属性

    3、上传图片显示不出来问题

    首先在ueditor.config.js中改动getUEBasePath()为的你的项目名加ueditor的形式 "/projectName/ueditor/"

    ueditor在1.4.2之后文件等上传路径在config.json中能够在里面改动存储路径。

    以下仅仅以图片上传为例其余类似

      "imageActionName": "uploadimage", /* 运行上传图片的action名称 */
        "imageFieldName": "upfile", /* 提交的图片表单名称 */
        "imageMaxSize": 2048000, /* 上传限制大小,单位B */
        "imageAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 上传图片格式显示 */
        "imageCompressEnable": true, /* 是否压缩图片,默认是true */
        "imageCompressBorder": 1600, /* 图片压缩最长边限制 */
        "imageInsertAlign": "none", /* 插入的图片浮动方式 */
        "imageUrlPrefix": "http://localhost:8080/yzm", /* 图片訪问路径前缀 */
        "imagePathFormat": "/ueditor1_4_3-utf8-jsp/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,能够自己定义保存路径和文件名称格式 */
                                    /* {filename} 会替换成原文件名称,配置这项须要注意中文乱码问题 */
                                    /* {rand:6} 会替换成随机数,后面的数字是随机数的位数 */
                                    /* {time} 会替换成时间戳 */
                                    /* {yyyy} 会替换成四位年份 */
                                    /* {yy} 会替换成两位年份 */
                                    /* {mm} 会替换成两位月份 */
                                    /* {dd} 会替换成两位日期 */
                                    /* {hh} 会替换成两位小时 */
                                    /* {ii} 会替换成两位分钟 */
                                    /* {ss} 会替换成两位秒 */
                                    /* 非法字符 : * ? " < > | */
                                    /* 具请体看线上文档: fex.baidu.com/ueditor/#use-format_upload_filename */

    当中一般须要我们配置的两个属性imagePathFormat,imageUrlPrefix。第一个是文件的保存路径。第二个文件訪问路径的前缀假设不加的话就会出现

    上传的图片已经成功可是不显示的情况。详细能够參考 http://fex-team.github.io/ueditor/#server-path

    版权声明:本文博客原创文章,博客,未经同意,不得转载。

  • 相关阅读:
    论文笔记之:Playing for Data: Ground Truth from Computer Games
    【计算机视觉领域】常用的 feature 提取方法,feature 提取工具包
    论文阅读之:Is Faster R-CNN Doing Well for Pedestrian Detection?
    论文笔记之:Generative Adversarial Nets
    如果读取图像的图像出现坏图,无法读取的怎么办?怎么自动跳过坏的图像,而读取下一张?
    (转)A Beginner's Guide To Understanding Convolutional Neural Networks
    (转) Written Memories: Understanding, Deriving and Extending the LSTM
    如果将彩色图像和灰度图像一起放进 CNN 中去,会是什么结果?
    3D CNN for Video Processing
    nodejs(四) --- cluster模块详解
  • 原文地址:https://www.cnblogs.com/yxwkf/p/4665630.html
Copyright © 2011-2022 走看看