// ad function dy(code) { var ojs=''; if (code=="top210x90_1"){ document.write(''); document.write(ojs);} if (code=="top210x90_2"){ document.write(''); document.write(ojs);} if (code=="top728x90&qu ot;){ document.writeln("'); document.write(ojs);} i
最近做了一版微信宣传页,通过JQ来判断设备,并进行下载
微信内置浏览器对下载链接进行了屏蔽,所以先进行判断,如果是微信内置浏览器,则跳转应用宝链接,如果不是,则判断是iPhone/Adroid/PC 并进行跳转
代码如下:
function downloadApp(){
var u = navigator.userAgent;
var ua = navigator.userAgent.toLowerCase();
var isAndroid = u.indexOf('Andro