http://ask.dcloud.net.cn/article/795
发送参数的页面:
<button id="send" type="button" class="mui-btn mui-btn-blue mui-btn-block">按钮</button>
<script src="js/mui.js"></script>
<script type="text/javascript">
mui.init();
document.querySelector('#send').addEventListener('tap',function () {
var targetId = '123';
var ws = plus.webview.create("new.html","new",{top:"0px",bottom:"0px"});
ws.evalJS('send('+targetId+')');
ws.show();
})
</script>
接收参数的页面:
<div class="mui-content">
<div id="text"></div>
</div>
<script src="js/mui.js"></script>
<script type="text/javascript">
mui.init();
// 接收参数的函数
function send(param){
document.getElementById("text").innerHTML = param;
}
</script>
2 个回复
Trust - 少说废话
可以用localStorage等本地存储来实现。
赵梦欢 - 专注前端,乐于分享!
http://ask.dcloud.net.cn/article/795
发送参数的页面:
接收参数的页面: