码迷,mamicode.com
首页 > 其他好文 > 详细

代码控制 textarea 控件是否为KindEditor 编辑框

时间:2014-09-04 16:43:29      阅读:131      评论:0      收藏:0      [点我收藏+]

标签:color   os   io   ar   for   cti   代码   sp   html   

  <script charset="utf-8" src="<%:Url.Content("~/UI/Scripts/KindEditor/kindeditor.js") %>"></script>
    <script charset="utf-8" src="<%:Url.Content("~/UI/Scripts/KindEditor/lang/zh_CN.js") %>"></script>
    <script charset="utf-8" src="<%:Url.Content("~/UI/Scripts/KindEditor/prettify.js") %>"></script>

<script>

  function LoadEditor(TextName) {
            var editor = KindEditor.create(‘textarea[name="‘ + TextName + ‘"]‘, {
                uploadJson: "/fileManagerJson/Index",
                fileManagerJson: ‘/fileManagerJson/DistanceIndex‘,
                allowFileManager: false,
                resizeType: 1,
                items: [‘undo‘, ‘redo‘, ‘|‘, ‘cut‘, ‘copy‘, ‘paste‘, ‘|‘, ‘selectall‘, ‘forecolor‘, ‘bold‘, ‘image‘, ‘multiimage‘],              
                autoHeightMode: true,
                afterCreate: function () {
                    this.loadPlugin(‘autoheight‘);
                },
                afterChange: function () {
                    this.sync();
                },
                afterBlur: function () {
                    this.sync();
                }
            });
            return editor;
        }

 

 

  $(function () {
            $("#aRefused").click(function () { //为激发事件
                $.ajax({
                    type: "POST",
                    url: "/Shared/OrderBackPop",
                    success: function (data) {
                        $("body").eq(0).append(data);//data返回的是html代码
                        var arrEditor = $("textarea[name=‘resonContent‘]");
                        $.each(arrEditor, function () {
                            // 加载编辑器
                            LoadEditor($(this).attr(‘name‘));
                        });
                    }

                });
            });
        });
    </script>

 

代码控制 textarea 控件是否为KindEditor 编辑框

标签:color   os   io   ar   for   cti   代码   sp   html   

原文地址:http://www.cnblogs.com/si-shaohua/p/3956124.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!