mui---通过ate创建webview并打开新页⾯并
传参到新页⾯
create_webview_home.html(主页)
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
<link href="css/mui.min.css" rel="stylesheet"/>
</head>
<body>
<button id="button1" class="mui-btn mui-badge-purple">打开⼦页</button>
<script src="js/mui.min.js"></script>
<script type="text/javascript">
mui.init();
html主页mui.plusReady(function() {
var nwating = plus.nativeUI.showWaiting(); //显⽰原⽣等待框
var webview_sub = ate(
'create_webview_sub.html',
'create_webview_sub', {}, {
name: 'davis'
}); //后台创建webview并打开页⾯
webview_sub.addEventListener('loaded', function() {
nwating.close(); //关闭等待框
webview_sub.show('slide-in-right', 150); //把新的webview窗⼝显⽰出来
}, false);
});
})
</script>
</body>
</html>
create_webview_sub.html(新页⾯)
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/> <link href="css/mui.min.css" rel="stylesheet"/>
</head>
<body>
<div id="div1"></div>
<script src="js/mui.min.js"></script>
<script type="text/javascript">
mui.init();
mui.plusReady(function () {
})
</script>
</body>
</html>
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论