百度UEditor的初始化
阿新 • • 發佈:2018-12-29
下載地址:http://wordonline.bj.bcebos.com/ueditor_release/ueditor1_4_3_1-utf8-jsp.zip
1,在專案的任一資料夾中建立一個用於存放UEditor相關資源和檔案的目錄
2,將下載的壓縮包中的內容複製到剛才建立的資料夾中
3,修改ueditor.config.js中的內容:
修改前:var URL = window.UEDITOR_HOME_URL || getUEBasePath();
修改後:var URL = window.UEDITOR_HOME_URL || '/ideatczl/WebContent/js/uEditor';
4,在需要使用的檔案中,引入UEditor必要的檔案(使用相對路徑,順序不能錯):
js/ueditor/ueditor.config.js
js/ueditor/ueditor.all.min.js
js/ueditor/themes/default/css/ueditor.css
js/ueditor/lang/zh-cn/zh-cn.js
5,建立簡單的編輯器例項,首先在頁面中準備一個dom容器:
<textarea rows="" cols="" id="editor" style="width:1024px;height:500px;"></textarea>
6,在瀏覽器中檢視效果