这是:简单模式代码
<script> var editor; KindEditor.ready(function(K) { editor = K.create('textarea[name="content"]', { resizeType : 1, allowPreviewEmoticons : false, allowImageUpload : false, items : [ 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', 'insertunorderedlist', '|', 'emoticons', 'image', 'link'] }); }); </script>
这是使用BR 换行代码:
<script> KindEditor.ready(function(K) { var editor; K('select[name=newlineTag]').change(function() { if (editor) { editor.remove(); editor = null; } editor = K.create('textarea[name="content"]', { newlineTag : this.value }); }); K('select[name=newlineTag]').change(); }); </script>
<select name="newlineTag"> <option value="br">BR换行</option> <option value="p">P换行</option> </select>
我现在想在简单模式直接默认为BR换行。如何整合二个JS.
create里加个newlineTag配置:
K.create('textarea[name="content"]', {
newlineTag:"br",
resizeType : 1,
....