使用文本编辑器控件KindEditor渲染文本域页面显示
this.sync()同步KindEditor的值到textarea文本框
editor.isEmpty()判断文本域是否是空
editer.text()获取文本域的值
//内容编辑器 var editor; KindEditor.ready(function(K) { var basePath = $(window.parent.document).find('#contextPath').val(); editor = K.create("#txt", { uploadJson: basePath + '/mcrs-upload/mvc/fileupload/editorUpload.json', 620, afterChange: function() { this.sync(); ifrHeight(); } }); }); var content = editor.isEmpty(); if(content){ dynamicAlert(message.serviceCenter.contentIsNotNull, message.defaults.tipTitle); return; } if(editor.text().length > 200){ dynamicAlert(message.news.contentMaxlength, message.defaults.tipTitle); return; }
官网:http://kindeditor.net/demo.php