<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>KindEditor</title>
    <link rel="stylesheet" href="./js/kindeditor/themes/default/default.css" />
    <script src="js/jquery-1.11.1.min.js" type="text/javascript"></script>
    <script charset="utf-8" src="./js/kindeditor/kindeditor.js"></script>
    <script charset="utf-8" src="./js/kindeditor/lang/zh_CN.js"></script>
    <script>
        KindEditor.ready(function (K) {
            var editor = K.create('#editor_id', {
                //上传管理 可自行在对应的文件按需求修改
                uploadJson: './js/kindeditor/asp.net/upload_json.ashx',
                //文件管理
                fileManagerJson: './js/kindeditor/asp.net/file_manager_json.ashx',
                allowFileManager: true,
                //设置编辑器创建后执行的回调函数
                afterCreate: function () {
                    var self = this;
                    K.ctrl(document, 13, function () {
                        self.sync();
                        K('form[name=example]')[0].submit();
                    });
                    K.ctrl(self.edit.doc, 13, function () {
                        self.sync();
                        K('form[name=example]')[0].submit();
                    });
                },
                //上传文件后执行的回调函数,获取上传图片的路径
                afterUpload: function (url) {
                    alert(url);
                },
                items:
                [
                        'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
                        'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
                        'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
                        'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
                        'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
                        'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage',
                        'flash', 'media', 'insertfile', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
                        'anchor', 'link', 'unlink', '|', 'about'
                ]
            });
        });
    </script>
</head>
<body>
    <div>
    <textarea id="editor_id" name="editor_id" style="width:700px;height:300px;">
    </textarea>
    </div>
</body>
</html>


本文转载:CSDN博客