这个坑耗费了我傍晚一直到晚上11点。
{load href="__PUBLIC__/js/kindeditor/themes/default/default.css,__PUBLIC__/js/kindeditor/plugins/code/prettify.css" /}
{load href="__PUBLIC__/js/kindeditor/kindeditor.js,__PUBLIC__/js/kindeditor/lang/zh_CN.js,__PUBLIC__/js/kindeditor/plugins/code/code.js,__PUBLIC__/js/kindeditor/plugins/code/prettify.js" /}
<script>
KindEditor.ready(function (K) {
var editor1 = K.create('textarea[name="content"]', {
cssPath: '__PUBLIC__/js/kindeditor/plugins/code/prettify.css',
uploadJson: '{:url("main/uploadEditor")}',
fileManagerJson: '',
allowFileManager: true,
newlineTag : 'p',
afterCreate: function () {
var self = this;
K.ctrl(document, 13, function () {
self.sync();
K('form[name=example]')[0].submit();
});
K.ctrl(self.edit.doc, 13, function () {
self.sync();
K('form[name=example]')[0].submit();
});
}
});
prettyPrint();
});
</script>
<!-- /KindEditor -->
<textarea id="content" name="content" style="width:780px;height:400px;"
class="textArea">[content]</textarea>
由于这里 总是有个[content] ,本人就删除了,结果悲剧了 编辑文章的时候 ,富文本编辑器始终出不来数据库对应的content字段的内容,只好恢复,好了,有了。