Hi
I'm using FCKeditor in an ajax application where i dynamically populate a div with a text area and turn it into an FCKeditor. The textarea html is generated on the server and sent to the client via ajax.
There are no page refreshes in this app - just dynamic html, replacing the contents of the main div.
If I populate the div with FCKeditor and then change the contents of the div, and then put the FCKeditor back in the div (this could happen if, say, a user was browsing around causing the contents of this div to change), then the resulting FCKeditor does not work properly - I get an error when I click on the Source button:
"sFormatted.trim is not a function"
I think this is because there are no page loads or refreshes between the first and second usage of FCKeditor, and the first FCKeditor is leaving some stuff behind in the DOM that's interfering with the second one.
My question is... is there any way to rest or clean up the stuff left behind by FCKeditor, so that the second usage behaves identically to the first?
Thanks for any info!
(I'm using Firefox and FCKeditor 2.0 in textarea-replace mode).
I'm using FCKeditor in an ajax application where i dynamically populate a div with a text area and turn it into an FCKeditor. The textarea html is generated on the server and sent to the client via ajax.
There are no page refreshes in this app - just dynamic html, replacing the contents of the main div.
If I populate the div with FCKeditor and then change the contents of the div, and then put the FCKeditor back in the div (this could happen if, say, a user was browsing around causing the contents of this div to change), then the resulting FCKeditor does not work properly - I get an error when I click on the Source button:
"sFormatted.trim is not a function"
I think this is because there are no page loads or refreshes between the first and second usage of FCKeditor, and the first FCKeditor is leaving some stuff behind in the DOM that's interfering with the second one.
My question is... is there any way to rest or clean up the stuff left behind by FCKeditor, so that the second usage behaves identically to the first?
Thanks for any info!
(I'm using Firefox and FCKeditor 2.0 in textarea-replace mode).
RE: Refresh/Clean/Uninitialize FCKeditor
I'll reply to myself as I have the answer, and this might just help some people in the distant future - like a kind of wonderful time capsule.
Anyway... if the SF search didn't run so incredibly slowly I might not have needed to post in the first place.... but, the answer lies at:
https://sourceforge.net/forum/message.p ... id=3290743
Essentially, you call:
__FCKeditorNS = null;
between different usages of the editor. Simple as that (well, there's a bit more to it perhaps, but see the above thread).