DroidScript wiki

(was AndroidScript) unofficial documentation by the community

User Tools

Site Tools


sample_code:using_app.execute

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
sample_code:using_app.execute [2015/10/30 20:46]
pedrod created
sample_code:using_app.execute [2015/10/30 20:56]
109.145.227.59 format JavaScript
Line 1: Line 1:
 Webviews are useful where you want to format a dynamic page, for example, you retrieve some data from sqlite and want to display it in a HTML table. Webviews are useful where you want to format a dynamic page, for example, you retrieve some data from sqlite and want to display it in a HTML table.
  
-If you want to embed links or buttons in the HTML, you need a way to pass data back to DSuse app.Execute +If you want to embed links or buttons in the HTML, you need a way to pass data back to DSuse app.Execute
-<​code>​+ 
 +Below is an example with two buttons, pressing a button raises a popup and displays the text passed back from the webview. 
 + 
 +<​code ​JavaScript execute.js>
 function OnStart()  function OnStart() 
  
Line 9: Line 12:
  
     //​ note the backslashes escaping the single quotes below     //​ note the backslashes escaping the single quotes below
 +
     var myjs = '<​script type="​text/​javascript">'​ +     var myjs = '<​script type="​text/​javascript">'​ +
                 '​ function myboo(id){ app.Execute("​b_test(\'"​ + id + "​\'​)"​)}</​script>'​ ;​                 '​ function myboo(id){ app.Execute("​b_test(\'"​ + id + "​\'​)"​)}</​script>'​ ;​
sample_code/using_app.execute.txt · Last modified: 2015/10/30 20:56 by 109.145.227.59