test


var params = GetRequest(); //獲取url參數
  
  var editor = UE.getEditor('myEditor', {
        //這里可以選擇自己需要的工具按鈕名稱,此處僅選擇如下五個
        toolbars: [['source', 'undo', 'redo', 'bold', 'italic', 'underline', 'fontborder', 'strikethrough', '|', 'removeformat', 'formatmatch', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
                'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
        'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
        'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
            'simpleupload', 'insertimage', 'emotion', 'scrawl', 'insertvideo', 'music', 'attachment']],
        //focus時自動清空初始化時的內容
        autoClearinitialContent: true,
        //關閉字數統計
        wordCount: false,
        //關閉elementPath
        elementPathEnabled: false,
        //默認的編輯區域高度
        initialFrameHeight: 300
    })

    if (params.id != "" && params.id != undefined) {
        // editor准備好之后才可以使用 ,不然不能使用setContent(),會報錯 Cannot set property 'innerHTML' of undefined
        editor.addListener("ready", function () {
            $.get("./Handlers/NewsHandler.ashx", { action: "getnewsbyid", id: params.id }, function (data) {
                var json = $.parseJSON(data);
                $("#txtTitle").val(json.Title);
                $("#selType").val(json.Type);
                $("#selStyle").val(json.Style);
                console.log($.parseHTML(json.Content)[0].data);
                if ($.parseHTML(json.Content)[0].data) {
                    editor.setContent($.parseHTML(json.Content)[0].data);
                } else {
                    editor.setContent(json.Content);
                }
            });

        });

    }

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM