简体   繁体   English

无法将HTML传递到tinymce编辑器

[英]Can't pass html into tinymce editor

I have saved raw html content into my database And I will like to load them into my tinymce editor so that users can just edit the content and submit again. 我已将原始html内容保存到数据库中,并且希望将它们加载到我的tinymce编辑器中,以便用户可以编辑内容并再次提交。 Below is the form; 下面是表格;

 <textarea id="postfullOnEditPop" type="text" class="validate" placeholder="Enter full post here" required>
 </textarea>

I tried to pass the content into TinyMCE like this; 我试图像这样将内容传递给TinyMCE。

tinymce.get('postfullOnEditPop').setContent(postfull);

but I get raw html tags instead of formatted text in the TinyMCE editor 但是我在TinyMCE编辑器中得到原始的html标签而不是格式化文本

Please does anyone knows what I am doing wrong? 请问有人知道我在做什么错吗?

Try: tinymce.get('postfullOnEditPop').setContent(postfull, {format: 'raw'}); 试试: tinymce.get('postfullOnEditPop').setContent(postfull, {format: 'raw'});

The API isn't super helpful here, unfortunately. 不幸的是, API在这里并不是很有用。

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

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