Fckeditor doesn’t want to focus in Firefox? Solution

Posted on the June 8th, 2006 under Uncategorized by Tohir

FCKEditor is a nice free WYSIWYG editor, highly customizable. Occasionally, however, especially when used with a div that shows/hides or JavaScript doesn’t want to focus properly in Firefox. Here’s a way I found around about it.

function wakeUpFireFoxFckeditor()
{
var oEditor = FCKeditorAPI.GetInstance(‘myinstanceoffckeditor’) ;
try
{
oEditor.MakeEditable();
}
catch (e) {}
oEditor.Focus();
}

Just to add:

  1. It’s best to call FCKeditorAPI – in fact you’d get an error if you did – after the page is loaded. Hence it’s in a function. You could probably tie it to a body onload, or onclick=”", etc.
  2. Use the try/catch approach. IE complains that you are waking up Firefox, so this is just a way to gracefully make both of them happy.
  3. Focus for usability. More commands available at: http://wiki.fckeditor.net/Developer%27s_Guide/Javascript_API


5 Responses to 'Fckeditor doesn’t want to focus in Firefox? Solution'

  1. July 12, 2006 at 3:11 pm
    Richard Binnington
  2. October 27, 2006 at 7:33 pm
    Anonymous
  3. February 2, 2007 at 9:09 pm
    Anonymous
  4. September 10, 2007 at 6:16 am
    Afnan
  5. October 10, 2007 at 9:06 pm
    A French Developper

Leave a Reply




XHTML::
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>