简体   繁体   中英

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. 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.get('postfullOnEditPop').setContent(postfull);

but I get raw html tags instead of formatted text in the TinyMCE editor

Please does anyone knows what I am doing wrong?

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

The API isn't super helpful here, unfortunately.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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