hi! there is code for ckeditor.
var ckeditorClasses = Array();
ckeditorClasses['editor'] = 'Full'; // Full editor
ckeditorClasses['medieditor'] = 'Medium'; // Medium editor
ckeditorClasses['minieditor'] = 'Basic'; // Mini editor
function ckeditorReplace() {
var textareas = document.getElementsByTagName('textarea');
for (var i = 0; i < textareas.length; i++) {
if (ckeditorClasses[textareas[i].getAttribute('class')] !== undefined) {
CKEDITOR.replace(textareas[i], {toolbar: ckeditorClasses[textareas[i].getAttribute('class')]});
}
}
}
this code connects the editor to the textarea If this function call $(document).ready(ckeditorReplace);
everything works normally.
BUT if a page to load via ajax
$(document).ajaxSuccess(function(){ckeditorReplace;});
then you receive the error: Uncaught The editor instance "rtext" is already attached to the provided element.
how to avoid it?
sorry for my English.