如何使用javascript动态创建tinymce实例?到目前为止,这是我的代码:
javascript:
$(function()
{
$("#onesnippet").click(function()
{
alert("One Snippet");
var idiv = document.getElementById('translations');
var newdiv = document.createElement('div');
newdiv.id = 10;
idiv.appendChild(newdiv);
var latestdiv = document.createElement('div')
latestdiv.id = 4;
newdiv.appendChild(latestdiv);
var textarea1 = document.createElement('textarea');
textarea1.id = "mceEditor3";
textarea1.className = "mceEditor";
latestdiv.appendChild(textarea1);
});
});
php 文件以包含 tinymce :
<script>
tinymce.init({mode : "specific_textareas", element : "mceEditor,mceEditor1,mceEditor2,mceEditor3", editor_selector : "mceEditor"});
</script>