标签:ext weixin style index mac os false 应用 define ati
<script type="text/javascript">
function download() {
// 判断是否是微信内
var u = navigator.userAgent;
var isWeixin = !!/MicroMessenger/i.test(u);
if (isWeixin) {
// 控制蒙层
document.getElementById(‘mask‘).style.display = ‘block‘;
} else {
var isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1; //android终端
var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
//android端
if (isAndroid) {
let hidden =
window.document.hidden ||
window.document.mozHidden ||
window.document.msHidden ||
window.document.webkitHidden;
if (typeof hidden == "undefined" || hidden == false) {
window.location.href = "https://xxx.apk"; //安卓应用市场地址
}
} else if (isIOS) {
//ios端
let hidden =
window.document.hidden ||
window.document.mozHidden ||
window.document.msHidden ||
window.document.webkitHidden;
if (typeof hidden == "undefined" || hidden == false) {
window.location.href = "http://apps.apple.com/cn/app/id387682726"; //app store地址
}
}
}
}
</script>
标签:ext weixin style index mac os false 应用 define ati
原文地址:https://www.cnblogs.com/jiqing9006/p/14896910.html