FckEditor javascript操作


var oEditor = FCKeditorAPI.GetInstance("spBlogText");//获取当前页面 FCK 编辑器实例
oEditor.SetHTML("http://www.mzwu.com/");//设置编辑器内容
oEditor.InsertHtml("木子屋");//添加内容到编辑器//在光标处添加内容
alert(oEditor.GetXHTML(true)); //获取编辑器内容
alert(oEditor.EditorDocument.body.innerText);//纯文本内容(IE Only)


 <script language="javascript" type="text/javascript" >
            function ReplaceAllTextareas() {
                // replace all of the textareas
                var allTextAreas = document.getElementsByTagName("textarea");
                for (var i = 0; i < allTextAreas.length; i++) {
                    var oFCKeditor = new FCKeditor(allTextAreas[i].name);
                    oFCKeditor.UserFilesPath = "~/Upload/";
                    oFCKeditor.BasePath = "/hhc_admin/HHC_Editer/";
                    oFCKeditor.ReplaceTextarea();
                }
            }
    </script>

你可能感兴趣的:(JavaScript)