ueditor使用注意點,ueditor使用

來源:互聯網
上載者:User

ueditor使用注意點,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在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


UEditor為何不可以使用?

首先要確定你的路徑是否寫正確了,我在本地弄的可以顯示出來,
你可以直接看從百度下載下來的demo
 
怎使用ueditor 1173

大哥你修改rms檔案不是用Ueditor吧,應該是UltraEdit。
這個Ueditor是相當於你在論壇發言或部落格上寫文章時用的編輯器。
UltraEdit才是可以編輯16進位和ascii檔案的文字編輯器啊。
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.