您好,我在Wordpress环境中使用Javascript文件将TinyMCE编辑器中的按钮与函数集成在一起。我想从select Tag字段中获取值,并将其用于进一步的操作。如何获取所选的值?
init : function(ed, url)
{
ed.addButton(\'code-hightlight\',
{
title : \'Code-Highlight\',
cmd : \'code-hightlight-cmd\',
image : url + \'/prism-icon.jpg\'
});
ed.addCommand(\'code-hightlight-cmd\', function()
{
tinymce.activeEditor.windowManager.open
({
title: \'Code-Highlighter\',
width : 300,
height : 300,
html :
\'<label>Programmiersprache:<select id="programming-language-id" name="programming-language-name" size="1"><option>ABAP</option><option>C#</option><option>CSS</option><option>HTML</option><option>Java</option><option>Javascript</option><option>PHP</option><option>SQL</option></select></label>\',
buttons: [
{
text: \'Bestätigen\',
onclick: function()
{
var id_id = tinymce.get(\'programming-language-id\');
alert(id_id);
var id_name = tinymce.get(\'programming-language-name\');
alert(id_name);
tinymce.activeEditor.execCommand(\'mceInsertContent\', false, "some text");
tinymce.activeEditor.windowManager.close();
}
},
{
text: \'Schließen\',
onclick: \'close\'
}
]
});
});
},