KindEditor无法设置内容的处理办法
看到很多人编辑器无法设置内容。把解决的问题写在上面。
不能用$("#Editor_XieYiNeiRong").html("helllo"); 或则$("#Editor_XieYiNeiRong").val("helllo"); 等形式。
希望能帮助到你。
editor_Editor_XieYiNeiRong.html(unescape(data[0].协议内容));
变量设置如下
var editor_Editor_XieYiNeiRong;
KindEditor.ready(function(K) {
editor_Editor_XieYiNeiRong = K.create('#Editor_XieYiNeiRong', {
cssPath: '/kindeditor/plugins/code/prettify.css',
uploadJson: urluploadimg, //'/ajax/UploadHandlerPhoto.aspx', // '/ajax/upload_json.ashx',处理图片的程序
fileManagerJson: '/ajax/file_manager_json.ashx',
allowFileManager: false,//true
filterMode: true,
urlType: "",
afterCreate: function() {
var self = this;
K.ctrl(document, 13, function() {
self.sync();
K('form[name=fm_Editor_XieYiNeiRong]')[0].submit();
});
K.ctrl(self.edit.doc, 13, function() {
self.sync();
K('form[name=fm_Editor_XieYiNeiRong]')[0].submit();
});
},
afterLoginOut: function() {
parent.loginagin();
}
});
prettyPrint();
});