I have a problem getting the Editor Instance via FCKeditorAPI.GetInstance in IE 6 and IE 7. The same script works fine in Firefox 1.5/2.0
I created the editor with this script:
...
<div id="editor-body" class="scrollbars">
<script>
<!--
var oFCKeditor = new FCKeditor('ed') ;
oFCKeditor.BasePath = '/FCKeditor_2_3_2/' ;
oFCKeditor.Height = "100%" ;
oFCKeditor.Value = 'This is some <strong>sample text<\/strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor<\/a>.' ;
oFCKeditor.Create() ;
//-->
</script>
</div>
...
I see the editor working fine. Then I have a script which calls
editor = FCKeditorAPI.GetInstance('ed');
In Firefox I get the editor reference without a problem. IE throws the Exception 'Object doesn't support this property/method'
I debuged
alert(FCKeditorAPI.Version);
alert(FCKeditorAPI.GetInstance);
return proper values for Version and the function GetInstance. The inner array __Instances of FCKeditorAPI seems to be empty though.
Any idea how this is possible?
thanks alot.
Thu, 01/18/2007 - 06:51
#1
RE: FCKeditorAPI.GetInstance fails in IE ?
FCKEditorAPI.GetInstance('ed') was not throwing the exception. The assign operation 'editor=...' did.
For some reason a global object 'editor' exists, that does not seem to allow the assign operation. I simply used a different variable name and that fixed the issue. I have a couple of other scripts in the page including yui, yui-ext that could have caused this. But I don't see a reason why this problem only appears in IE.
RE: FCKeditorAPI.GetInstance fails in IE ?
In other browsers you have to do document.getEementById("myDiv").innerHTML; but in IE you can just do myDiv.innerHTML
Sorry I was going to suggest this to you yesterday but got distracted.
HTH
Ron