How to pass arguments from tinyMCE to tinyMCEPopup?
I saw this solution: TinyMCE - Pass value from Popup
and I'm looking for something else? How do I create a variable in tinyMCE which I can access in tinyMCEPopup?
How to pass arguments from tinyMCE to tinyMCEPopup?
I saw this solution: TinyMCE - Pass value from Popup
and I'm looking for something else? How do I create a variable in tinyMCE which I can access in tinyMCEPopup?
There are several ways to access variables from a tinymce popup.
A. You may assign a variable to your editor object and later on access it from the popup: tinyMCEPopup.editor.my_variable = 'xyz';
B. You may assign a variable to your window object (from the maindocument): window.my_variable = 'xyz';
and access it later on using the openObject in case your popup is an own window: window.opener.my_variable
.
Does this solve your issue?
Each popup is an IFrame, which means that you can prefix any variable you want in the popup with window.parent. (like window.parent.[variable name]) to access any variable on your page.
Also, because the popup is an iframe, you can't actually directly pass in a variable on the window creation. But if you get a reference to the new iframe object directly you can of course get and set variables after the frame has been loaded.
Another option to consider would be to pass variables in on the url of the page you are loading.