Jump to content

How recall an JavaScript existing function from delphi


a.sanf

Recommended Posts

Hi to everybody

I have a html code on TuniURLframe as URLframe

<!DOCTYPE html>
<html>
<body>
<p>example id="demo".</p>
<p id="demo"></p>
<script type="text/javascript">
function myFunction() {
  document.getElementById("demo").innerHTML = "Hello World!";
}
</script>
</body>
</html>

And with a UniButton I want recall existing function "myFunction"

I try with "URLframe.JSInterface.JSCall('myFunction', ['']) but it does not work. 

Any suggestions ?

And if it were possible I would like to set a variable declared on the Javascript code from delphi. Is this possible ?

Antonio

Link to comment
Share on other sites

Hi mhmda

I don't know if possibile, but I have HTML code with javascript, and a object TUniURLframe called in this example URLframe.

After I have loaded the html page on TUniURLframe.HTML, I want (if possibile) call javascript function "myFunction" from delphi code, for example URLframe.JSInterface.JSAdd(etc..) or similar

Thanks

Antonio

Link to comment
Share on other sites

  • 3 weeks later...
On 2/25/2021 at 3:15 AM, a.sanf said:

I don't know if possibile, but I have HTML code with javascript, and a object TUniURLframe called in this example URLframe.

After I have loaded the html page on TUniURLframe.HTML, I want (if possibile) call javascript function "myFunction" from delphi code, for example URLframe.JSInterface.JSAdd(etc..) or similar

Hello,

These posts may help you:

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...