主题: 翻译下这段代码
作者: 上善若水, 发布日期: 2012-07-05 11:29:16, 浏览数: 2273
var editor;
KindEditor.ready(function(K) {
editor = K.create('textarea[name="content"]', {
allowFileManager : true
});
下面这段怎么用
document.getelementbyid('aa').appendHtml('<strong>添加HTML</strong>');
这样的形式写啊,那些框架什么的真难懂,都不知道代码该放哪里了
K('input[name=appendHtml]').click(function(e) {
editor.appendHtml('<strong>添加HTML</strong>');
});
 
 
我是照着这么写的可就是找不到对象

  KindEditor.ready(function (K) {
            var editor1 = K.create('#content1', {
                cssPath: '/jsfile/plugins/code/prettify.css',
                uploadJson: '/jsfiles/upload_json.ashx',
                fileManagerJson: '/jsfiles/file_manager_json.ashx',
                allowFileManager: true,
                afterCreate: function () {
                    var self = this;
                    K.ctrl(document, 13, function () {
                        self.sync();
                        K('form[name=form1]')[0].submit();
                    });
                    K.ctrl(self.edit.doc, 13, function () {
                        self.sync();
                        K('form[name=form1]')[0].submit();
                    });

                    k('a[name=insertpagetitle]').click(function (e) {
                        var str = document.getElementById("PageTitle");
                        if (str.value != "")
                            editor1.insertHtml('[NT:PAGE=' + str.value + '$]');
                        else
                            editor1.InsertHtml('[NT:PAGE]');
                    });

                }
            });
            prettyPrint();
        });

 
发表新帖 发表回复