Hi all,
I have just discovered this great tool and trying to use it in my website. I am doing php programming and using a jquery adapter to make the editor show up in a div. I have two pages called openclosediv.php and content.php. In openclosediv.php page I have list of records and a button(show/hide div button) in openclosediv.php and these buttons brings content.php into openclosediv.php . In content.php page I have a ckeditor whenever I click the button, told above, the first time ckeditor appears however, after the first time whenever I push the button ckeditor does not appear.
Here is the code which shows/hides the div in openclosediv.php :
function ShowHideDiv(divid)
{
var block=document.getElementById(divid).style.display;
if(block=="none")
{
document.getElementById(divid).style.display="block";
}
else
{
document.getElementById(divid).style.display="none";
}
var data="divid="+divid;
jQuery('#'+divid).showLoading();
$.ajax({
type: "POST",
url: "content.php",
data: data,
error: function(){
alert('Error while loading!');
},
success: function(data){
jQuery('#'+divid).hideLoading();
$('#'+divid).html(data);
}
});
}
And here how I creat ckeditor in content.php:
$ckeditor = new CKEditor();
$ckeditor->basePath = 'ckeditor/' ;
CKFinder::SetupCKEditor( $ckeditor, 'ckfinder/' ) ;
$config['height'] = '300';
$config['width'] = '700';
$initialValue = "";
$ckeditor->editor("somename", $initialValue, $config);
Thanks in advance.
I have just discovered this great tool and trying to use it in my website. I am doing php programming and using a jquery adapter to make the editor show up in a div. I have two pages called openclosediv.php and content.php. In openclosediv.php page I have list of records and a button(show/hide div button) in openclosediv.php and these buttons brings content.php into openclosediv.php . In content.php page I have a ckeditor whenever I click the button, told above, the first time ckeditor appears however, after the first time whenever I push the button ckeditor does not appear.
Here is the code which shows/hides the div in openclosediv.php :
function ShowHideDiv(divid)
{
var block=document.getElementById(divid).style.display;
if(block=="none")
{
document.getElementById(divid).style.display="block";
}
else
{
document.getElementById(divid).style.display="none";
}
var data="divid="+divid;
jQuery('#'+divid).showLoading();
$.ajax({
type: "POST",
url: "content.php",
data: data,
error: function(){
alert('Error while loading!');
},
success: function(data){
jQuery('#'+divid).hideLoading();
$('#'+divid).html(data);
}
});
}
And here how I creat ckeditor in content.php:
$ckeditor = new CKEditor();
$ckeditor->basePath = 'ckeditor/' ;
CKFinder::SetupCKEditor( $ckeditor, 'ckfinder/' ) ;
$config['height'] = '300';
$config['width'] = '700';
$initialValue = "";
$ckeditor->editor("somename", $initialValue, $config);
Thanks in advance.
Re: ckeditor disappears while refreshing div
Maybe this can help: https://dev.ckeditor.com/ticket/8924
If not, check the dev site for similar scenarios. You may also create a new ticket if you feel it's a new bug.
Customer and Community Manager, CKSource
Follow us on: Facebook, Twitter, LinkedIn
If you think you found a bug in CKEditor, read this!
Re: ckeditor disappears while refreshing div
Nice post. I like it. Thanks for sharing these information. Keep it up.