FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Calling a function from a function
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM

Calling a function from a function

Posted: Wed Feb 08, 2023 08:27 PM
I upload approximately the following HTML text to the Webview.
How to call the myfunc() function using the oWebview:Eval() method ?

(DG - external handler)
Code (fw): Select all Collapse
<!DOCTYPE html>
<html>
    <head>
    </head>
    <body>
       <script>
   
        DG.then(function() {
           function myfun() {
              alert(123) ;
           } ;
        }) ;

      </script>
    </body>
</html>
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: Calling a function from a function

Posted: Thu Feb 09, 2023 08:03 AM

oWebview:Eval( "myfun()" )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM

Re: Calling a function from a function

Posted: Thu Feb 09, 2023 08:51 AM
If so, then oWebview:Eval("myfun()") does not work
Code (fw): Select all Collapse
DG.then(function() {
     function myfun() {
           alert(123) ;
      } ;
 }) ;
If so, then oWebview:Eval("myfun()") works well
Code (fw): Select all Collapse
DG.then(function() {
}) ;
 function myfun() {
      alert(123) ;
  } ;

Continue the discussion