Jump to content

run function of javascript


Recommended Posts

 

 

I have the following code and it works correctly in UnimHTMLFrame, now I would like to execute the function from the click event of a button to pass it a parameter 

 

 <input type="button" value="Say hello" onClick="showAndroidToast('Hello Android!')" />

    <script type="text/javascript">
        function showAndroidToast(toast) {
            Android.showToast(toast);
        }
    </script>
    
 

 

Link to post
Share on other sites
6 minutes ago, easegura777 said:

UnimButton

Try this, for example:

procedure TMainmForm.UnimButton1Click(Sender: TObject);
begin
  (Sender as TUnimButton).JSInterface.JSCall('showAndroidToast', ['Hello'])
end;

 

Link to post
Share on other sites
13 minutes ago, Sherzod said:

Try this, for example:


procedure TMainmForm.UnimButton1Click(Sender: TObject);
begin
  (Sender as TUnimButton).JSInterface.JSCall('showAndroidToast', ['Hello'])
end;

 

Not found!!

Link to post
Share on other sites
×
×
  • Create New...