Javascript 在动态加载的内容上加载TinyMCE
在我的页面中,我根据按下的按钮加载不同的文本区域。假设用户单击按钮a,则此脚本称为:Javascript 在动态加载的内容上加载TinyMCE,javascript,jquery,html,tinymce,tinymce-4,Javascript,Jquery,Html,Tinymce,Tinymce 4,在我的页面中,我根据按下的按钮加载不同的文本区域。假设用户单击按钮a,则此脚本称为: $("body").on("click", "a#pages-menu", function() { var page = $(this).attr("id"); $(".inject").load("Including/modules/"+page+"/index.php", function () { }); }); 在这个模块上,有一个我想初始化TinyMCE的。我尝试使用Tin
$("body").on("click", "a#pages-menu", function() {
var page = $(this).attr("id");
$(".inject").load("Including/modules/"+page+"/index.php", function () {
});
});
在这个模块上,有一个我想初始化TinyMCE的。我尝试使用TinyMCE文档提供的一些代码,但没有成功:
<script type="text/javascript">
function setup() {
tinyMCE.init({
mode : "textareas",
theme : "advanced",
plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true
});
}
</script>
然后在加载后安装,但正如我之前所说的,这不起作用。你能创建一个JSFIDLE复制这个问题吗?@MelanciaUK这是基本系统,我不知道如何添加TinyMCE,我甚至无法将它导入JSFIDLE中。。。