简体   繁体   English

bootstrap-wysiwyg设置内容

[英]bootstrap-wysiwyg Set Content

How to set content to bootstrap-wysiwyg editor dynamically with jQuery. 如何使用jQuery动态地将内容设置为bootstrap-wysiwyg编辑器。 I tried 我试过了

$('.editor').html() and $('.editor').val() 

Seems to like none of them are accepting 似乎没有人接受

After struggling lot I found the way 经过艰苦的努力,我找到了方法

var editorObj = $("#description").data('wysihtml5');
var editor = editorObj.editor;
editor.setValue(data.description);

在此输入图像描述 Try this, $("#editor").html("I am a <b>bold</b> text."); 试试这个, $("#editor").html("I am a <b>bold</b> text.");

wysiwyg editor will show as content as expected as below wysiwyg编辑器将显示如下所示的内容

"I am a bold text" “我是一个大胆的文字”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM