TinyMCE - 从弹出窗口传递值 [英] TinyMCE - Pass value from Popup

查看:43
本文介绍了TinyMCE - 从弹出窗口传递值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 TinyMCE.单击时,我成功打开了内联弹出窗口.但我不知道如何将值从弹出窗口传递到 tinyMCE.非常感谢任何帮助.

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
    });

推荐答案

我自己花了一些时间才找到它.这并不难.要将 HTML 从弹出窗口插入编辑器,您可以使用类似

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

使用tinyMCEPopup.editor,您可以从打开弹出窗口的位置寻址编辑器.例如,您可以使用

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

这篇关于TinyMCE - 从弹出窗口传递值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆