自己不会。只好来这里求了。合并二个JS

这是:简单模式代码

<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.

鸿蒙传说
浏览 460回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript