Android与js交互实例(2)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0032):8080/jsAndroid/ -->
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-store,no-cache">
<meta content="true">
<meta content="width=100%; initial-scale=1.0; user-scalable=yes">
<meta content="all">
<meta contect="doodle, mobile, doodlemobile, game, games">
<meta content="Make People's Mobile Life More Connected Through Games.">

<title>jsandroid_test</title>

<script type="text/javascript" language="javascript">
 
 function showHtmlcallJava(){
  var str = window.jsObj.HtmlcallJava();
  alert(str);
 }
 
 function showHtmlcallJava2(){
  var str = window.jsObj.HtmlcallJava2("IT-homer blog");
  alert(str);
 }
 
 function showFromHtml(){
  document.getElementById("id_input").value = "Java call Html";
 }
 
 function showFromHtml2( param ){
  document.getElementById("id_input2").value = "Java call Html : " + param;
 }
</script>
</head>


<body>

hello IT-homer

<br>
<br>
<br>

<input type="button" value="HtmlcallJava" />
<br>
<input type="button" value="HtmlcallJava2" />

<br>
<br>
<br>
<br>

<input type="text" value="null" />
<br>
<input type="button" value="JavacallHtml" />

<br>
<br>
<br>

<input type="text" value="null" />
<br>
<input type="button" value="JavacallHtml2" />

</body>
</html>

linux

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/d146a7634b1a3bcfcdd099fa93ef0f6e.html