美文网首页
Android和js交互 ,js例子

Android和js交互 ,js例子

作者: Android_小马范儿 | 来源:发表于2018-09-09 23:53 被阅读0次

<body>
<p>测试 JS调本地相册</p>
<a class="rect" onclick="sendInfoToAndroid()">JS调用相册</a>
<p><t id="img" src="file:///android_asset/a.png" width="100" height="100"/></p>
<input type="text" id="show"/>
<script>

function sendInfoToAndroid(){
//调用Android的方法启动相册
window.android.getLocationInfo();
}

function setAppLocation(path){
document.getElementById("show").value=path;
}

</script>
</body>

相关文章

网友评论

      本文标题:Android和js交互 ,js例子

      本文链接:https://www.haomeiwen.com/subject/miljgftx.html