I am doing some php programming with jquery adapter and ckeditor on my page. Let me show what I have. The page I am working on is index.php
A jquery adapter:
function sendid(id)
{
jQuery('#mydiv').showLoading();
$.ajax({
type: "POST",
url: "",
data: id,
error: function(){
alert('error');
},
success: function(data){
jQuery('#mydiv').hideLoading();
$('#mydiv').html(data);
}
});
}
}
This function sends an id to index.php . Whith this Id I am fetching my database and get some records. With the record I got, I am displaying it via ckeditor like this:
<?php
$ckeditor = new CKEditor();
$ckeditor->basePath = 'ckeditor/' ;
CKFinder::SetupCKEditor( $ckeditor, 'ckfinder/' ) ;
$config['height'] = '300';
$initialValue = $queryresult['content'];
$ckeditor->editor('FCKeditor1', $initialValue, $config);
?>
Whenever I click the button which calls sendid() function ckeditor appears above the list of ids. The first time when I call sendid() function it works ok and puts the record into ckeditor. However second time I call the sendid() function ckeditor disappears.
I found a topic in this link:
CKEditor instance already exists
but it becomes very hard for me, where to place the codes mentioned in the link. As far as I understood I have to kill or destroy the editor everytime I click the button for sending the id to sendid() function. But whenever I put destroy or kill ckeditor into sendid() function it did not work.
Could you please help me on this.