码迷,mamicode.com
首页 > Web开发 > 详细

One QRcode , link another url

时间:2016-05-27 10:53:27      阅读:238      评论:0      收藏:0      [点我收藏+]

标签:

Desc :

  One QRCode , can accroding to user Agent division different platforms

 1 var platform = " Unknow"
 2 var desc = " Unknow"
 3  
 4 var Terminal = {   
 5     platform :function(){   
 6     var u = navigator.userAgent, app = navigator.appVersion;   
 7     return { 
 8     trident: u.indexOf(‘Trident‘) > -1, //ie
 9     presto: u.indexOf(‘Presto‘) > -1, //oper
10     webKit: u.indexOf(‘AppleWebKit‘) > -1, //apple or goolge
11         gecko: u.indexOf(‘Gecko‘) > -1 && u.indexOf(‘KHTML‘) == -1, //firefox 
12         mobile: !!u.match(/AppleWebKit.*Mobile.*/), //mobile 
13     ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios 
14     android: u.indexOf(‘Android‘) > -1 || u.indexOf(‘Linux‘) > -1, //android or uc 
15     iPhone: u.indexOf(‘iPhone‘) > -1 , // iPhone or QQ
16     iPad: u.indexOf(‘iPad‘) > -1, //iPad   
17     webApp: u.indexOf(‘Safari‘) == -1 //Safari
18     };   
19     }(),   
20 language:(navigator.browserLanguage || navigator.language).toLowerCase()   
21 }   
22           
23 
24     var url_base = ‘xxxxxx‘;
25     var url_android = ‘xxxxx‘;
26     var url_ios = ‘xxxx‘;
27         
28     if(Terminal.platform.android){
29        url_base = url_android;
30        desc = "android"
31     }else{
32        url_base = url_ios
33       desc = "IOS"
34     }

 

di

 

vision

One QRcode , link another url

标签:

原文地址:http://www.cnblogs.com/Nancy0401/p/5533546.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!