原文地址:http://ssh-2009-126-com.javaeye.com/blog/599501 <mce:script type="text/javascript" src="<your installation path><!-- /tiny_mce/tiny_mce.js"> // --></mce:script> <mce:script type="text/javascript"><!-- // Creates a new plugin class and a custom listbox tinymce.create('tinymce.plugins.ExamplePlugin', { createControl: function(n, cm) { switch (n) { case 'mylistbox': var mlb = cm.createListBox('mylistbox', { title : 'My list box', onselect : function(v) { tinyMCE.activeEditor.windowManager.alert('Value selected:' + v); } }); // Add some values to the list box mlb.add('Some item 1', 'val1'); mlb.add('some item 2', 'val2'); mlb.add('some item 3', 'val3'); // Return the new listbox instance return mlb; case 'mysplitbutton': var c = cm.createSplitButton('mysplitbutton', { title : 'My split button', image : 'img/example.gif', onclick : function() { tinyMCE.activeEditor.windowManager.alert('Button was clicked.'); } }); c.onRenderMenu.add(function(c, m) { m.add({title : 'Some title', 'class' : 'mceMenuItemTitle'}).setDisabled(1); m.add({title : 'Some item 1', onclick : function() { tinyMCE.activeEditor.windowManager.alert('Some item 1 was clicked.'); }}); m.add({title : 'Some item 2', onclick : function() { tinyMCE.activeEditor.windowManager.alert('Some item 2 was clicked.'); }}); }); // Return the new splitbutton instance return c; } return null; } }); // Register plugin with a short name tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin); // Initialize TinyMCE with the new plugin and listbox tinyMCE.init({ plugins : '-example', // - tells TinyMCE to skip the loading of the plugin mode : "textareas", theme : "advanced", }); // --></mce:script> <form method="post" action="somepage"> <textarea name="content" style="width:100%">