需求:公司要求做一个二维码,自动判断扫码客户端,跳转到指定下载平台:
//var u = navigator.userAgent;
//var isA = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
//var isI = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
//var isw = !!u.match(/MicroMessenger/i);
//if (isA) {
// if (isw)
// location.href = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.fineex.xingdian';
// else
// location.href = 'http://appapi.fuqiantonglu.com/download/FINEEX-KZG.apk';
//}
//else if (isI) {
// location.href = 'https://itunes.apple.com/cn/app/fu-gan-xing-dian-yi-dong-fen/id1193890515?mt=8#';
//}
//else {
// location.href = 'http://vshop.fuqiantonglu.com';
//}
转载请说明出处!谢谢