我在前台也面定义了两个kindeditor,但是第二个老是提示未定义,应该如何定义两个kindeditor

chen110210 chen110210 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
代码如下
var editor1,editor2;
KindEditor.ready(function () {
editor1 = KindEditor.create('#txtDesc', {
cssPath: 'kindeditor/plugins/code/prettify.css',
uploadJson: 'kindeditor/asp.net/upload_json.ashx',
fileManagerJson: 'kindeditor/asp.net/file_manager_json.ashx',
allowFileManager: true,
syncType: "auto",
afterCreate: function () {
var self = this;
KindEditor.ctrl(document, 13, function () {
self.sync();
KindEditor('form[name=example]')[0].submit();
});
KindEditor.ctrl(self.edit.doc, 13, function () {
self.sync();
KindEditor('form[name=example]')[0].submit();
});
},
afterChange: function () { this.sync(); },
afterBlur: function () { editor1.sync(); }
});

var editor2 = KindEditor.create('#TextDesc', {
cssPath: 'kindeditor/plugins/code/prettify.css',
uploadJson: 'kindeditor/asp.net/upload_json.ashx',
fileManagerJson: 'kindeditor/asp.net/file_manager_json.ashx',
allowFileManager: true,
syncType: "auto",
afterCreate: function () {
var self = this;
KindEditor.ctrl(document, 13, function () {
self.sync();
KindEditor('form[name=example]')[0].submit();
});
KindEditor.ctrl(self.edit.doc, 13, function () {
self.sync();
KindEditor('form[name=example]')[0].submit();
});
},
afterChange: function () { editor2.sync(); },
afterBlur: function () { editor2.sync(); }
});

prettyPrint();
});

0x800a138f - JavaScript 运行时错误: 无法获取未定义或 null 引用的属性“html”
...全文
评论 4
收藏 已收藏
分享
返回顶部
chen110210
ASP 28,401 成员 356,940 内容