HTML頁代碼:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title></title>
<script type="text/javascript">
調用JAVA類的方法
functionnext(){
vartextvalue =(document.getElementByIdx_x('num1').value);
window.ncp.clickOnAndroid_saveIdnumber(textvalue);
}
這個JS方案是專門給JAVA回傳用的
function wave(value){
document.getElementByIdx_x("XX").value= value;
}
</script>
</head>
<body >
<table width="962" height="748" border="0"cellpadding="0" cellspacing="0"bordercolor="F2F2F2">
<tr>
<td>
<input type="text" id="num1" />
<input type="text" id="XX"/>
<input type="button"name="Submit1" value="" onclick="next();" class="BOTTOM" style="background-color:#000000;border-width:0px
"/>
</td>
</tr>
</table>
</body>
</html>
JAVA代碼: