【问题标题】:FCKEditor: Access content areaFCKEditor:访问内容区域
【发布时间】:2012-03-20 00:43:18
【问题描述】:

我在执行此操作时遇到问题。我无法访问内容区域对象。我需要它来附加一个点击监听器。

var oFCKeditor = new FCKeditor( editorName ) ;
        oFCKeditor.BasePath = o.editorPath;
        if (o.configPath) {
            oFCKeditor.Config["CustomConfigurationsPath"] =     o.configPath +"?" + ( new Date() * 1 ) ;
        }
        oFCKeditor.Width = '100%';
        oFCKeditor.Height = '100%';
        oFCKeditor.ReplaceTextarea();
        oFCKeditor.setEnabled(true);

        alert(oFCKeditor.EditorDocument);
        alert(oFCKeditor.EditorWindow);
                    alert(FCK); 

我还尝试从 FCKEditor 代码中的不同部分访问那里的对象,但没有运气。

我做错了什么?这样做的通常方法是什么?

谢谢

编辑:当我这样做时:

var oEditor = FCKeditorAPI.GetInstance(editorName) ;
alert(oEditor.EditorDocument); 

在创建编辑器后它可以工作,但只有当我使用调试器单步执行它时,否则它是未定义的。所以这可能是一个时间问题。但那我应该从哪里得到呢?

【问题讨论】:

    标签: javascript fckeditor clicklistener


    【解决方案1】:
    <script type="text/javascript">      
            var object;
    
            function FCKeditor_OnComplete(editorInstance) 
            {            
                object = editorInstance;   
            }
            function Display()
            {
              alert( object.GetHTML());
            }
       </script>
    

    【讨论】:

    • 你应该在发布答案时添加一些解释。
    【解决方案2】:
    猜你喜欢
    • 1970-01-01
    • 2017-08-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-02
    • 2013-08-09
    • 2012-10-31
    • 1970-01-01
    相关资源
    最近更新 更多