Calling a function from a function

Calling a function from a function

Postby Natter » Wed Feb 08, 2023 8: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: Select all  Expand view  RUN
<!DOCTYPE html>
<html>
    <head>
    </head>
    <body>
       <script>
   
        DG.then(function() {
           function myfun() {
              alert(123) ;
           } ;
        }) ;

      </script>
    </body>
</html>
Natter
 
Posts: 1224
Joined: Mon May 14, 2007 9:49 am

Re: Calling a function from a function

Postby Antonio Linares » Thu Feb 09, 2023 8:03 am

oWebview:Eval( "myfun()" )
regards, saludos

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

Re: Calling a function from a function

Postby Natter » Thu Feb 09, 2023 8:51 am

If so, then oWebview:Eval("myfun()") does not work
Code: Select all  Expand view  RUN
DG.then(function() {
     function myfun() {
           alert(123) ;
      } ;
 }) ;


If so, then oWebview:Eval("myfun()") works well
Code: Select all  Expand view  RUN
DG.then(function() {
}) ;
 function myfun() {
      alert(123) ;
  } ;
 
Natter
 
Posts: 1224
Joined: Mon May 14, 2007 9:49 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 54 guests