m3h*_*hdi 6 javascript jquery tinymce function rte
如何调用tinymce插件函数?
tinymce.activeEditor.plugins.customplugin.customfunction(customvar);
Run Code Online (Sandbox Code Playgroud)
不工作!
tinymce.activeEditor.plugins.customplugin.customfunction(customvar);
是调用此类函数的正确方法。请注意,tinymce.activeEditor
需要先进行设置才能使用它。
tinymce.activeEditor
例如,当用户单击编辑器时进行设置。否则使用
tinymce.get('your_editor_id_here').plugins.customplugin.customfunction(customvar);
Run Code Online (Sandbox Code Playgroud)
您的函数调用不起作用可能还有另一个原因:您想要调用的函数需要像函数一样定义getInfo
,_save
并且_nodeChange
在保存插件中(请参阅tinymce的开发人员版本以在插件目录中检查此插件)。
保存插件在这里缩短:
(function() {
tinymce.create('tinymce.plugins.Save', {
init : function(ed, url) {
...
},
getInfo : function() {
...
},
// Private methods
_nodeChange : function(ed, cm, n) {
...
},
// Private methods
...
_save : function() {
}
});
// Register plugin
tinymce.PluginManager.add('save', tinymce.plugins.Save);
})();
Run Code Online (Sandbox Code Playgroud)
您可以getInfo
使用以下 javascript 调用来调用此插件的功能:
tinymce.get('your_editor_id_here').plugins.save.getInfo();
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
5750 次 |
最近记录: |