Hbuilder 嵌套外部链接
在首页增加跳转:
<script type="application/javascript">
function show() {
//打开关于页面
mui.openWindow({
url: 'MuBan.html',
id: 'info'
});
localStorage.setItem("urls", "http://phone.hx.cn/dianzidangan/JSTK/JSTKHome.html?gh=" +"j0009900");
}
</script>
<body>
<button οnclick="show()">跳转外部链接</button>
</body>
在另一个界面:
<script type="text/javascript">
//判断是否是iphone x
function isIphoneX() {
return /iphone/gi.test(navigator.userAgent) && (screen.height == 812 && screen.width == 375);
}
var immersedIos = isIphoneX();
var urls = localStorage.getItem("urls");
alert(urls);
mui.init();
mui.init({
subpages: [{
url: urls,
id: 'list.html',
styles: {
top: '60px', //mui标题栏默认高度为45px;
bottom: '0px' //默认为0px,可不定义;
}
}]
});
</script>
可以实现嵌套外部链接