JS error if editor loaded within a div with display:none

Looking for help? Ready to help? That's the place to go.

Re: JS error if editor loaded within a div with display:none

Postby foo123 » Fri May 09, 2008 8:12 pm

I have this error also.
FCKEditor 2.6 internals/fck.js line 898

range.select(); <----- error happens here

So IE is throwing an exception because the _FCK_PaddingNodeListener is trying to select a range while hidden. There probably needs to be some code in this listener to return if the editor is not visible.

This listener is not run if FCKConfig.EnterMode = 'br'; is set. ( if you can live with that )

As a quick hack (and fix for me), I put a try/catch around the select() to ignore this specific error:

Code: Select all
range.moveToElementText( paddingNode ) ;

try {
range.select() ;
if ( clearContents )
range.pasteHTML( '' ) ;
} catch (e)
{
  if ( e.number != -2146827682 )
    throw e ;
}
foo123
 
Posts: 19
Joined: Fri Jun 29, 2007 2:05 pm

Re: JS error if editor loaded within a div with display:none

Postby foo123 » Fri May 09, 2008 8:33 pm

foo123
 
Posts: 19
Joined: Fri Jun 29, 2007 2:05 pm

Re: JS error if editor loaded within a div with display:none

Postby maxim.soloviev » Tue May 13, 2008 12:48 am

Just updated FCKeditor to 2.6 and still see issues when editor is in hidden div. :(
maxim.soloviev
 
Posts: 14
Joined: Tue Feb 12, 2008 5:48 am

Re: JS error if editor loaded within a div with display:none

Postby maxim.soloviev » Tue May 13, 2008 1:04 am

Just applied patch you have posted and it works very well :) Thank you very much :)
maxim.soloviev
 
Posts: 14
Joined: Tue Feb 12, 2008 5:48 am

Re: JS error if editor loaded within a div with display:none

Postby muyu » Thu Oct 30, 2008 9:51 am

I've solved the problem!

the right field need a default value.

也就是,
fckeditor对应的字段不能为空值,设一个默认的值,就可以回避该错误!
muyu
 
Posts: 1
Joined: Thu Oct 30, 2008 9:46 am

Re: JS error if editor loaded within a div with display:none

Postby mediamacros » Fri Jan 30, 2009 4:29 pm

Is there a better fix for this? We using visibility or CSS to hide is not an option as we are using AJAX/DHTML to open and close the area using effects. The div has to be display=none. Any other ways around this?
mediamacros
 
Posts: 1
Joined: Fri Jan 30, 2009 4:28 pm

Re: JS error if editor loaded within a div with display:none

Postby zhancis » Tue May 26, 2009 9:20 am

Thanks so much for this (i mean the try-catch fix)!! Works like a treat! Except the file i had to edit was the compressed version in /editor/js/fckeditorcodecode_ie.js
z
zhancis
 
Posts: 1
Joined: Tue May 26, 2009 9:19 am

Re: JS error if editor loaded within a div with display:none

Postby jmontoya » Fri Aug 28, 2009 7:43 pm

Thanks man, you really save my ass!
In fact the "nodisplay" class is a class with a display:none
.media { display:none;}
jmontoya
 
Posts: 1
Joined: Fri Aug 28, 2009 7:38 pm

Re: JS error if editor loaded within a div with display:none

Postby jmweb » Mon Aug 31, 2009 8:11 am

mediamacros wrote:Is there a better fix for this? We using visibility or CSS to hide is not an option as we are using AJAX/DHTML to open and close the area using effects. The div has to be display=none. Any other ways around this?


I experienced this very same error with CKEditor3.0.
My editor is placed in an animated div that opens and closes. My solution was to call CKEDITOR.replace(a,...) AFTER the animation completes and the div display attribute has been set to 'block'.
jmweb
 
Posts: 31
Joined: Sat Aug 29, 2009 11:24 am

Re: JS error if editor loaded within a div with display:none

Postby alnbala » Sat Sep 12, 2009 7:18 am

Hai, somebody suggest to include teh FCKeditor_OnComplete( editorInstance ).
To where and how it should be placed, Can you Tell me that Please ?
alnbala
 
Posts: 2
Joined: Wed Aug 19, 2009 5:38 am

PreviousNext

Return to Support

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 6 guests