I have a javascript function defined that executes these two lines of code:
var oEditor = FCKeditorAPI.GetInstance('FCKeditor1'); alert(oEditor.GetHTML());
In IE7 the alert accurately displays the editor contents. However, in FF3 it displays "null".
Is there an issue with FF? Is there a workaround? Or am I doing something incorrect?
As a side note if this helps troubleshoot the issue, the editor is being loaded via this php:
include("fckeditor/fckeditor.php") ; $oFCKeditor = new FCKeditor('FCKeditor1') ; $oFCKeditor->Value = '<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>' ; $oFCKeditor->Height = '450px'; $oFCKeditor->Create() ;
Re: FCKeditorAPI GetHTML not working in FF
Re: FCKeditorAPI GetHTML not working in FF
Yes.
At this URL, the editor is always visible, no other javascript libraries are in use, and everything appears to work correctly in both IE7 and FF3.
http://www.jasonhendrix.com/fckeditor_test/test.php
However, at this URL it works ok in IE7 but not in FF3. This page hides the editor until a button is pressed utilizing the jquery ui javascript library. It looks like that library or the fact that the div is hidden at first is causing an issue. Can this be made to work in FF too?
http://www.jasonhendrix.com/fckeditor_test/test2.php
Thanks,
Jason
Re: FCKeditorAPI GetHTML not working in FF
That second page is really incredible slow
It almost kills Firefox, I would suggest you to review the libraries that you are using and what they are doing, your users won't be happy with that performance.
With regards to the problem itself: check what happens when you hide the div with normal javascript, the problem might be that Firefox isn't loading the contents of iframes that are hidden, so you would need to use a workaround like creating it off the screen. Anyway, the problem isn't that GetHTML fails, but that you aren't getting a reference to an FCKEditor instance when you try to read it.