Appearance

多功能编辑器

ueditor是目前比较流行的一款功能强大,兼容性好,容易上手的web编辑器 想查看强大的API请 查看这里open in new window

组件集成了amd 规范,在requirejs里调用执行

webuploader 示例代码

html:

注意这里的class hk_editor_required表示必填,如果页面有多个编辑器,class 必须带前缀editorkey_,并且 "_" 后的名称即为编辑器在js中的变量定义名,多个编辑器并存值必须不能相同,另外,编辑器必须指定宽高。

<script id="editor" class="hk_editor hk_editor_required editorkey_myue" name="myue" type="text/plain" style="width:99%;height:300px;"></script>

js:

最普通的无设置的editor,直接在 js 里引入lib/editor,初始化执行editor()

define(['lib/editor'] ,function(editor){
    var back = {
        init : function () {
            editor();
        }
    }
    return back;
});