2012-03-01 76 views
1

我遇到问题了。我无法访问内容区域对象。我需要它附加一个点击监听器。FCKEditor:访问内容区域

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); 

创建它的作品编辑后,但只有当我通过它加强与调试器,否则它是不确定的。所以这可能是一个计时问题。但是,我应该在那里得到?

回答

0
<script type="text/javascript">  
     var object; 

     function FCKeditor_OnComplete(editorInstance) 
     {    
      object = editorInstance; 
     } 
     function Display() 
     { 
      alert(object.GetHTML()); 
     } 
    </script> 
+0

发布的答案时,你应该添加一些说明。 – 2013-03-22 13:04:09