TinyMCE - Pass value from Popup

2019-03-31 15:08发布

I am using TinyMCE . On a Click I am opening an inline popup successfully.But I have no idea how I can pass a value from popup to tinyMCE.Any help highly appreciated.

tinyMCE.activeEditor.windowManager.open({
    file : "options.jsp",
    title : 'Image Manager',
    width : 800, 
    height : 600,
    resizable : "yes",
    inline : "yes", 
    close_previous : "no",
    win : window
    });

1条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-03-31 15:14

Took me some time to find it out myself. It is not that difficult. To insert HTML to your editor from the popup you may use something like

var my_html_code = 'New phrase!';
tinyMCEPopup.execCommand('mceInsertContent', false, my_html_code);

Using tinyMCEPopup.editor you may address the editor from where you opened the popup. You could for example set a variable in the editor using

tinyMCEPopup.editor.new_variable = 'blah blah';
查看更多
登录 后发表回答