中国建设部网站监理延续,aws 知乎 wordpress,关键词优化时间,台山网页设计培训开始 需要调用Kindeditor中的readonly的方法#xff0c;但是一直提示edit is undefined 而editor.readonly(true)又只对第一个对象有效 所以只能换换形式#xff0c;干脆将下面的kindeditor拿上来 虽然是满足自己这个需求#xff0c;但是真正的原因解决办法#xff0c;还是…开始 需要调用Kindeditor中的readonly的方法但是一直提示edit is undefined 而editor.readonly(true)又只对第一个对象有效 所以只能换换形式干脆将下面的kindeditor拿上来 虽然是满足自己这个需求但是真正的原因解决办法还是没有出来 script src/assets/global/plugins/kindeditor/kindeditor.js typetext/javascript/script
script src/assets/global/plugins/kindeditor/lang/zh_CN.js typetext/javascript/script
script typetext/javascriptvar editor;var awardEditor;KindEditor.ready(function (K) {awardEditor K.create(textarea[replace_nameaward_show], {minWidth: 400,allowFileManager: true,uploadJson: /Merchant/KindEditor/Upload?IsWater1,items: [source, fontname, fontsize, |, forecolor, hilitecolor, bold, italic, underline,removeformat, |, justifyleft, justifycenter, justifyright, insertorderedlist,insertunorderedlist],afterCreate: function () {this.sync();},afterBlur: function () {this.sync();},afterChange: function () {$(textarea).each(function () {$(# $(this).attr(replace_name)).html($(this).val());})}});editor K.create(textarea, {minWidth: 400,allowFileManager: true,uploadJson: /Merchant/KindEditor/Upload?IsWater1,items: [source, fontname, fontsize, |, forecolor, hilitecolor, bold, italic, underline,removeformat, |, justifyleft, justifycenter, justifyright, insertorderedlist,insertunorderedlist],afterCreate: function () {this.sync();},afterBlur: function () {this.sync();},afterChange: function () {$(textarea).each(function () {$(# $(this).attr(replace_name)).html($(this).val());})}});});/script View Code editor.readonly(true)作用的对象也同样是awardEditor所作用的对象 awardEditor.readonly(true)有效 这个问题先放着好了纠结太久纯粹有些浪费时间说不定等到什么时候就想通了 突然发现上方的 K.create(textarea[nameaward_show]是不可以的即使加了号还是会进行两次初始化 所以还是给改成 K.create([namemode_show],[namerequire_show],[nameintroduction_show] 至于两个对象的readonly都是第一个对象大概只对第一个对象有用吧