第一步,访问UEditor官方地址http://ueditor.baidu.com/website/, 选择完整版下载,如图 第二步, 第三步:在项目的任一文件夹中建立一个用于存放UEditor相关资源和文件的目录,此处在项目根目录下建立,起名为ueditor。
第四步:拷贝源码包中的dialogs、themes、third-party、editor_all.js和editor_config.js到ueditor文夹中。其中,除了ueditor目录之外的其余文件均为具体项目文件,此处所列仅供示例。
第五步:为简单起见,此处将以根目录下的index.php页面作为编辑器的实例化页面,用来展示UEditor的完整版效果。首先在需要载入UEditor的页面,导入编辑器需要的三个入口文件,示例代码如下: < SCRIPT type = text /javascript src = "ueditor/editor_config.js" ></ SCRIPT > < SCRIPT type = text /javascript src = "ueditor/editor_all.js" ></ SCRIPT > < LINK rel = stylesheet
href = "ueditor/themes/default/ueditor.css" > 第六步:然后需要载入UEditor的页面中创建编辑器实例及其DOM容器。具体代码示例如下: < DIV id = myEditor ></ DIV > < SCRIPT type = text /javascript> var
editor = new
baidu.editor.ui.Editor(); editor.render("myEditor"); </ SCRIPT > 第七步: URL= window.UEDITOR_HOME_URL||
|
|