我是按 id 创建的,三个都没有问题
KindEditor.ready(function(K) {
K.create('#' + ID, {
uploadJson : uploadAction,
allowFileManager : false,
filePostName : 'imgFile',
dir:'image',
width : 820,
height : 280,
resizeType : 1,
KindEditor.ready(function(K) {
K.create('#' + ID, {
uploadJson : uploadAction,
allowFileManager : false,
filePostName : 'imgFile',
dir:'image',
width : 820,
height : 280,
resizeType : 1,
引用的是kindeditor-min.js
KindEditor.ready(function(K) {
var editor = K.create('textarea[id="test1"]', {
cssPath : '../kindeditor/plugins/code/prettify.css',
uploadJson : '../kindeditor/jsp/upload_json.jsp',
fileManagerJson : '../kindeditor/jsp/file_manager_json.jsp',
allowFileManager : true,
afterCreate : function() {
var self = this;
K.ctrl(document, 13, function() {
self.sync();
document.forms['example'].submit();
});
K.ctrl(self.edit.doc, 13, function() {
self.sync();
document.forms['example'].submit();
});
}
});
prettyPrint();
});
<p id="class3content">
test1:
<span class="box1right_tupian">
<textarea name="classProject.conFour" cols="50" rows="20" style="width:270px;height:130px;" id="test1"></textarea>
</span>
<br/>多个换成这样格式 还是顶多看到两个插件
它这个编辑器也是有很多bug的。
如果再不行,你就使用官方的demo 修改。
把你html文件 的其他代码都去掉,使用一份纯净的文件来测试编辑器。
KindEditor.ready(function(K) {
window.editorTwo = K.create('#conFour');
}); <span class="box1right_tupian">
<textarea name="classProject.conFour" cols="50" rows="20" style="width:270px;height:130px;" id="conFour"></textarea>
</span>