kindEditor编辑器不修改数据直接保存后变成空值

代码如下:

var infoEdit, featureEdit, info, feature = null;
            $(function () {
                infoEdit = createEditor('infoEdit');
                featureEdit = createEditor('featureEdit');
                info = createEditor('info');
                feature = createEditor('feature');
            });

            function createEditor(eleId) {
                var editor = KindEditor.create('#' + eleId, {
                    resizeType: 1,
                    filterMode: true,
                    allowPreviewEmoticons: false,
                    allowImageUpload: false,
                    items: ['cut', 'copy', 'paste', '|', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript', 'superscript', '|', 'selectall', 'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'strikethrough', 'removeformat', 'lineheight', '|', 'advtable', 'hr', 'link', 'unlink'],
                    afterCreate: function() { // kindeditor创建后,将编辑器的内容设置到原来的textarea控件里
                        this.sync(eleId);
                    },
                    afterChange: function() { // 编辑器内容发生变化后,将编辑器的内容设置到原来的textarea控件里
                        this.sync(eleId);
                    },
                    afterBlur: function() { // 编辑器失焦后,将编辑器的内容设置到原来的textarea控件里
                        this.sync(eleId);
                    }
                });
                return editor;
            }
阅读 3.7k
1 个回答

1.在服务端打印下提交的数据,如 $_POST
2.服务端是否有过滤
3.编辑器配置参数有误
4.入库的时候打断点看下数据

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进