TinyMCE - Pass value from Popup

情到浓时终转凉″ 提交于 2019-12-05 02:45:18

问题


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:


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';


来源:https://stackoverflow.com/questions/5504524/tinymce-pass-value-from-popup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!