web

落地页下载

2021-12-23  本文已影响0人  闭眼思回忆

落地页下载;

安卓ios判断;

$(".download").on("click",function(){

var u = navigator.userAgent;

var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端

var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端

var android_url = 'xx/werewolfbattle/310_yoka_2.apk'

var ios_url = 'https://apps.apple.com/cn/app/idxxx'

if(isAndroid){

var iframe = document.createElement('iframe');

iframe.style.display = 'none';

iframe.src = android_url;

document.getElementsByTagName('body')[0].appendChild(iframe);

}else if(isiOS){

window.location = ios_url;

}else{

var iframe = document.createElement('iframe');

iframe.style.display = 'none';

iframe.src = android_url;

document.getElementsByTagName('body')[0].appendChild(iframe);

}

})

上一篇下一篇

猜你喜欢

热点阅读