Function call

Function call

Postby Natter » Sat Feb 04, 2023 4:10 pm

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 view
function aaa() {
     alert(12345) ;
  }

If I try to call this function :Eval('aaa()'), then nothing happens.

If I do so:
Code: Select all  Expand view
<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 ?
Natter
 
Posts: 1221
Joined: Mon May 14, 2007 9:49 am

Re: Function call

Postby Antonio Linares » Mon Feb 06, 2023 7:40 am

Please try using :Eval('alert( 12345 )')
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 85 guests