Page 1 of 1

Function call

Posted: Sat Feb 04, 2023 4:10 pm
by Natter
Hi,

There is a WebView object and an html text is loaded into it using the :setHtml method.
There is an aaa() function in this text.

Code: Select all | Expand

 function aaa() {
     alert(12345) ;
  }
If I try to call this function :Eval('aaa()'), then nothing happens.

If I do so:

Code: Select all | Expand

<button id='tst' style='display:none;'>Test function</button>

  document.getElementById('tst').onclick = aaa ;
  function aaa() {
     alert(12345) ;
  }
:Eval('document.getElement.ById("tst").click') - then the aaa() function is normally executed

Why can't I get a direct function call ?

Re: Function call

Posted: Mon Feb 06, 2023 7:40 am
by Antonio Linares
Please try using :Eval('alert( 12345 )')