admin管理员组文章数量:1357592
I am working on eCommerce Project where Html text editor is needed and i choose TinyMCE. TinyMCE is nice editor for editing text.
I use Asp MVC4 and mysql database for storing data of tinyMCE. I am easily able to get the content of tinyMCE editor By using
tinymce.get("textfull").getContent({ format: 'raw' }).replace(/</g, "<").replace(/>/g, ">");
this code provide me HTML encoded text but i want to show this text on new tinyMCE Editor by using this code
tinymce.get("textfull").setContent($("<div/>").html(d.Description).text());
but this code set html Text not Html rendered content on browser
Please tell me what is the correct way to show as HTML Element not text.
I am working on eCommerce Project where Html text editor is needed and i choose TinyMCE. TinyMCE is nice editor for editing text.
I use Asp MVC4 and mysql database for storing data of tinyMCE. I am easily able to get the content of tinyMCE editor By using
tinymce.get("textfull").getContent({ format: 'raw' }).replace(/</g, "<").replace(/>/g, ">");
this code provide me HTML encoded text but i want to show this text on new tinyMCE Editor by using this code
tinymce.get("textfull").setContent($("<div/>").html(d.Description).text());
but this code set html Text not Html rendered content on browser
Please tell me what is the correct way to show as HTML Element not text.
Share Improve this question edited Jan 11, 2016 at 9:28 NorCode asked Jan 11, 2016 at 8:01 NorCodeNorCode 6891 gold badge12 silver badges33 bronze badges 1- Did you try to refresh the tinyMCE after data is set? – anmarti Commented Jan 11, 2016 at 8:22
1 Answer
Reset to default 6You could try
tinymce.get("textfull").getBody().innerHTML = $("").html(d.Description).text();
or
tinymce.get("textfull").getBody().innerHTML = d.Description;
本文标签: javascriptHow to set Html Content in TinyMCEStack Overflow
版权声明:本文标题:javascript - How to set Html Content in TinyMCE - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744077754a2587062.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论