j-s 获-取-终-端的相关信息(根据访-问类-型跳-转)
来源:互联网 发布:靠谱淘宝 外贸 知乎 编辑:程序博客网 时间:2024/06/08 17:59
<script type="text/javascript"> // 获-取终-端的相关信息 var Terminal = { // 辨-别移-动终-端类-型 platform : function(){ var u = navigator.userAgent, app = navigator.appVersion; return { // android终-端或者uc浏-览器 android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, // 是否为iPhone或者QQHD浏览器 iPhone: u.indexOf('iPhone') > -1 , // 是否iPad iPad: u.indexOf('iPad') > -1, //微信 weChat: u.indexOf('MicroMessenger') > -1 }; }(), // 辨-别移动终-端的语言:zh-cn、en-us、ko-kr、ja-jp... language : (navigator.browserLanguage || navigator.language).toLowerCase() } // 根据不同的终-端,跳转到不同的地址 var theUrl = 'http://www.j.com/app/index.html'; if(Terminal.platform.android){ if(Terminal.platform.weChat){ theUrl = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.j.news'; }else{ theUrl = 'http://m.j.com/app/android_download.html'; } }else if(Terminal.platform.iPhone){ if(Terminal.platform.weChat) { document.getElementById("popweixin").style.display = "block"; theUrl = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.j.news'; }else{ theUrl = 'https://itunes.apple.com/cn/app/jie-mian-xin-wen/id930342070?mt=8'; } }else if(Terminal.platform.iPad){ theUrl = 'https://itunes.apple.com/cn/app/jie-mian-xin-wen/id930342070?mt=8'; // 还可以通过language,区分开多国语言版 /*switch(Terminal.language){ case 'en-us': theUrl = '你的iPad APP(英文版)对应下载地址:APP Store地址'; break; case 'ko-kr': theUrl = '你的iPad APP(韩语版)对应下载地址:APP Store地址'; break; case 'ja-jp': theUrl = '你的iPad APP(日文版)对应下载地址:APP Store地址'; break; default: theUrl = '你的iPad APP(中文版-默认)对应下载地址:APP Store地址'; }*/ } // 如果要分渠道,也是可以的,渠道区分:?from=xx // var From = (function(){ // var searchInfo = location.search.substr(1).split('&'),item,from; // for(var i= 0,len=searchInfo.length;len > 1 && i<len;i++){ // item = searchInfo[i].split('='); // if(item[0] == 'from') { // from = item[1]; // break; // } // } // return from; // })(); // if(Terminal.platform.android){ // // 这里区分渠道 // switch(From){ // case 'baidu': // if(Terminal.platform.weixin) { // theUrl = '你的App:微云上的地址'; // }else{ // theUrl = '你的APP:baidu定制版'; // } // break; // case 'google': // if(Terminal.platform.weixin) { // theUrl = '你的App:微云上的地址'; // }else{ // theUrl = '你的APP:google定制版'; // } // break; // default: // if(Terminal.platform.weixin) { // theUrl = '你的App:微云上的地址'; // }else{ // theUrl = '你的APP:官方版'; // } // } // } location.href = theUrl;</script>
0 0
- j-s 获-取-终-端的相关信息(根据访-问类-型跳-转)
- 根据经纬取点的地理位置信息
- 取BOM的相关信息报表。
- R第七问 从数据库取数分别导出到不同的excel(根据名称)
- 从i到j(i<j)中随机取n个数的随机算法
- [j2se] 根据apk包获得apk的相关信息
- Python取周的相关信息的几个函数
- 简单Python3爬虫程序(5)进阶:知乎网的登录与用户相关信息爬取
- 根据经纬度获取所在城市的相关信息以及根据地点城市获取经纬度
- 取任务栏的句柄及相关信息(仅以取任务栏的高度为例)
- access根据字段的值取值,(取空,截取字符串)
- 动态规划中的最优二叉搜素树的介绍与理解(包含c源代码打印相关数据:e[i][j],root[i][j],w[i][j])
- Android实践 -- 根据应用的包名获得应用相关信息
- 根据身份证号或营业执照编号取省市区信息
- 根据ebayno爬取可见信息 本地+数据库
- SQLServer类型与Java类型转换问题解决
- struts里的检验问s
- Android根据文件路径使用File类获取文件相关信息
- 《数据结构与算法分析》寻找欧拉回路--多次修改最终复杂度O(E+V)
- 前端注意事项总结
- iOS 蓝牙4.0(BLE)后台或者锁屏也可以接收数据的方法
- TCL第三代黑水晶超薄电视C1上市 缔造业界新高度
- CABasicAnimation, CAKeyframeAnimation,CAAnimationGroup动画的用法
- j-s 获-取-终-端的相关信息(根据访-问类-型跳-转)
- linux网络编程中常用的辅助函数
- ubuntu14.04 安装google chrome
- 每个人都会记得一些事,那些让自己成熟的过程。
- Data Structure for HTML DOM with compare text inside
- Parcelable和Serializable的区别:
- P3-weixin 微信插件式开发规范
- Fastest Gaussian Blur in CPU
- LINUX卸载mysql