js中获取Fckeditor的值

<script type="text/javascript" language="javascript">

    function a()

    {

            //得到控件的html

             var checkContent =FCKeditorAPI.GetInstance("FCKeditor1").GetXHTML();

            alert(checkContent);

            //得到html的长度

             var len = FCKeditorAPI.GetInstance("FCKeditor1").GetXHTML().length;

            alert(len);

            //得到fck控件

            var oEditor = FCKeditorAPI.GetInstance('FCKeditor1');

            //得到编辑器中的文字

            var text = oEditor.EditorDocument.body.innerText;

            alert(text);

            //让编辑器得到焦点

            oEditor.Focus();

    }

    </script>

posted on 2011-05-11 19:22  八度空间  阅读(217)  评论(0)    收藏  举报

导航