Get JS-Variable within HTML-Viewer

Hi,

I know, that the HTML-Viewer in a webapp is an iFrame. I use it to display an TinyMCE-Editor, and it works fine.

My question is now:

is it possible to get the value of a variable within the iFrame?
If I use a button for example in the iFrame with this JS-script it works::

<input type=button value=""Try it now""onClick=""alert(tinyMCE.get('area1').getContent())"">

But how can I get the value into my XojoApp to handle it?

I tried also to set the TinyMCE Editor in the WebPage (not in an iFrame) but I always got JSExceptions :frowning:

 me.ExecuteJavaScript("document.getElementById('" + ContainerControl11.ControlID + "').innerHTML = '" + THE_EDITOR_CODE + "';")

[quote=152483:@Lars Lehmann]Hi,

I know, that the HTML-Viewer in a webapp is an iFrame. I use it to display an TinyMCE-Editor, and it works fine.

My question is now:

is it possible to get the value of a variable within the iFrame?
If I use a button for example in the iFrame with this JS-script it works::

<input type=button value=""Try it now""onClick=""alert(tinyMCE.get('area1').getContent())"">

But how can I get the value into my XojoApp to handle it?

I tried also to set the TinyMCE Editor in the WebPage (not in an iFrame) but I always got JSExceptions :frowning:

 me.ExecuteJavaScript("document.getElementById('" + ContainerControl11.ControlID + "').innerHTML = '" + THE_EDITOR_CODE + "';")

One thing you can do is call an URL on your app and use App.HandleURL to catch that. You can do that with any kind of link.

Since HandleURL will fire for any subfolder in your app, you can dedicate one for passing string variables, such as

/PassVar/?var=ThisismyVariable