多个TinyMCE [英] multiple TinyMCE
本文介绍了多个TinyMCE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我最近在开发包含多个TinyMCE的页面时遇到了问题。
I have recently encountered a problem while developing a page with multiple TinyMCEs.
<textarea style='width:90%;height:500px;' class='tinymce' name='message' id="mce_editor_0" placeholder='Long Message'>{if isset($message)}{$message}{/if}</textarea>
<textarea style='width:90%;height:200px;' class='tinymce' name='signature' id="mce_editor_1" placeholder='Long Message'></textarea>
$.ajax({
url: "../action/getEmailTemplate?id="+id+'&type='+type
}).done(function ( data ) {
console.log("../action/getEmailTemplate?id="+id+'&type='+type);
console.log(data);
if(type=='email'){
tinyMCE.execCommand('mce_editor_0', 'mceSetContent', false, data);
}
if(type=='sig'){
tinyMCE.execCommand('mce_editor_1', 'mceSetContent', false, data);
}
});
这不起作用。我是否误解了tinyMCE.execCommand背后的逻辑?
And this does not work. Do I misunderstand the logic behind tinyMCE.execCommand?
推荐答案
这不起作用。您将在此处找到正确的使用说明。
This won't work. You will find the correct usage description here.
您可以使用tinyMCE调用通用命令,并且在编辑器实例上调用特定于编辑器的命令:
There are generall commands you may call using tinyMCE and there are editor-specific commands called on an editor instance:
tinymce.get('mce_editor_1').execCommand('mceCodeEditor', false, 5);
您还可以使用以下内容来处理特定编辑器
You may also use the following to address a specific editor
tinyMCE.execInstanceCommand('mce_editor_1', command, user_interface, value, focus)
这篇关于多个TinyMCE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文