如何使用jquery将HTML加载到TinyMCE textarea中 [英] How to load html using jquery into a TinyMCE textarea
本文介绍了如何使用jquery将HTML加载到TinyMCE textarea中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个使用TinyMCE作为所见即所得的文本区域. 加载完该文本区域后,我想要这样做,单击编辑"按钮,将随AJAX jquery带来的一些html代码加载到该文本区域中.
I've a textarea that uses TinyMCE as a WYSIWYG. Once that this textarea is loaded I want that, clicking a button "Edit" some html code that I bring with AJAX jquery is loaded in that textarea.
我要插入此html代码<p>hello</p>
I want to insert this html code <p>hello</p>
原始文本区域来源
<textarea name="corpo" id="input_corpo">Text Here</textarea>
带HTML的JQUERY脚本.这样,它仅更新文本区域(在TinyMCE运行时隐藏)
JQUERY Script that brings the HTML. In this way it updates only the textarea (which is hidden while TinyMCE is in action)
$.get("hello.html",
function(content){ $("#input_corpo").text(content);});
return false;});
下面的任何一种都不起作用.我试图更新生成TinyMCE的iframe的主体
Neither in this way below it works. I tryed to update the body of the iframe that generates TinyMCE
$.get("hello.html",
function(content){ $("body#tinymce").text(content);});
return false;});
我该怎么办?
推荐答案
查看全文