我有这两行代码.
tinymce.execCommand('mceAddControl',true,'email_body');
tinyMCE.activeEditor.setContent(data.tplCustom.htmltemplate);
第二行尝试在锡饼完成之前设置内容.我觉得原因我得到“tinyMCE.activeEditor是空”的错误.
有没有办法等到它加载?谢谢
解决方法
TinyMCE版本4使用了一个稍微不同的事件绑定方法.
版本3
// v3.x
tinymce.init({
setup : function(ed) {
ed.onInit.add(function(ed) {
console.debug('Editor is done: ' + ed.id);
});
}
});
版本4
// v4.x
tinymce.init({
setup: function (ed) {
ed.on('init',function(args) {
console.debug(args.target.id);
});
}
});
参考:
http://www.tinymce.com/wiki.php/API3:event.tinymce.Editor.onInit
http://www.tinymce.com/wiki.php/Tutorial:Migration_guide_from_3.x