Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/10.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
HtmlBox JQuery插件_Jquery_Jquery Plugins_Web Scripting - Fatal编程技术网

HtmlBox JQuery插件

HtmlBox JQuery插件,jquery,jquery-plugins,web-scripting,Jquery,Jquery Plugins,Web Scripting,我正在使用HtmlBox 2.8() 将文本区域转换为richtext编辑器 当我更改textarea的值时,$('#Survey_value').val(data.value) richeditor中的文本不会更改 如何更改文本富文本编辑器中的文本?HtmlBox有一个设置文本(html)方法,您可以调用该方法。存储您现在拥有的原始htmlbox调用: var box = $('#Survey_Value').htmlbox(); 当您有新数据时,请调用以下命令: box.set_text(

我正在使用HtmlBox 2.8()
将文本区域转换为richtext编辑器

当我更改textarea的值时,
$('#Survey_value').val(data.value)
richeditor中的文本不会更改


如何更改文本富文本编辑器中的文本?

HtmlBox有一个
设置文本(html)
方法,您可以调用该方法。存储您现在拥有的原始htmlbox调用:

var box = $('#Survey_Value').htmlbox();
当您有新数据时,请调用以下命令:

box.set_text(data.Value);

此方法接受html并将设置
的值。

我尝试过,但它只在现有的富文本编辑器中添加了一个新的富文本编辑器(具有新值)editor@CoffeeCode-不知道它不会检测到这一点,更新了答案,这种方法应该有效,如果有其他问题,请告诉我。