Get result data from a JS function
Posted: Wed Nov 14, 2018 10:36 pm
Hi all,
After take a look at the demo applications, I realized it's very simple to send data from my Delphi program to a JS script located at the webpage in use by the component. What I would like to have is actually the opposite. I would like to load a page with a form in it, a button element in the form could be used to start a JS function that builds a JSON text from the form's other elements. I would like to have this JSON text in a string variable after the JS function finishes its execution.
What I'm doing to have this functionality at this point, is to adapt the code present at the "JSDialogBrowser" demo, changing the functionality of the JS "alert()" function to something like the code below:
Is there a "smarter" way to achieve such functionality? Could you give me some indications about how to have it?
Thanks
After take a look at the demo applications, I realized it's very simple to send data from my Delphi program to a JS script located at the webpage in use by the component. What I would like to have is actually the opposite. I would like to load a page with a form in it, a button element in the form could be used to start a JS function that builds a JSON text from the form's other elements. I would like to have this JSON text in a string variable after the JS function finishes its execution.
What I'm doing to have this functionality at this point, is to adapt the code present at the "JSDialogBrowser" demo, changing the functionality of the JS "alert()" function to something like the code below:
Code: Select all
JSDIALOGTYPE_ALERT: MyVar := FMessageText;
Thanks