Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/264.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 刷新div后不会出现Ckeditor_Php_Jquery_Ckeditor - Fatal编程技术网

Php 刷新div后不会出现Ckeditor

Php 刷新div后不会出现Ckeditor,php,jquery,ckeditor,Php,Jquery,Ckeditor,我试图在php上使用jQuery适配器将初始值分配给ckeditor。但是,每当jquery刷新div时(其中有一个ckeditor),ckeditor就会消失。 以下是我定义编辑器的方式: $ckeditor = new CKEditor(); $ckeditor->basePath = 'ckeditor/' ; CKFinder::SetupCKEditor( $ckeditor, 'ckfinder/' ) ; $config['height'] = '300'; $initia

我试图在php上使用jQuery适配器将初始值分配给ckeditor。但是,每当jquery刷新div时(其中有一个ckeditor),ckeditor就会消失。 以下是我定义编辑器的方式:

$ckeditor = new CKEditor();
$ckeditor->basePath  = 'ckeditor/' ;
CKFinder::SetupCKEditor( $ckeditor, 'ckfinder/' ) ;
$config['height'] = '300';
$initialValue = $result['field'];
$ckeditor->editor('CKeditor1', $initialValue, $config);
以下是jquery部分:

function myfunction(id) {
   jQuery('#mydiv').showLoading();
   var variable = "id=" + id;
   $.ajax({
       type: "POST",
       url: "requiredpage.php",
       data: yol,
       error: function () {
           alert('Errorrr!');
       },
       success: function (data) {
           jQuery('#mydiv').hideLoading();
           $('#mydiv').html(data);
       }
   });
}

感谢高级版中的所有内容。

CKeditor重新编写了DIV,jQuery也这样做了。但由于jQuery对CKEditor结构一无所知,因此它破坏了编辑器功能


看看这里:

我可以想象,当您调用.html()时,您正在删除编辑器。您想在执行ajax后更改ckeditor数据吗?在这里“$('#mydiv').html(data);”您已经更改了mydiv元素的内容,因此编辑器将丢失。我有一些记录的列表,在该列表下面有一些输入框和编辑器。用户可以创建新记录或编辑现有记录。每当我单击每条记录旁边的编辑时,其他输入框都会填充记录,但ckeditor会消失。