zoukankan      html  css  js  c++  java
  • app下载——js设备判断

    摘自:今日头条
    <!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>app下载</title> <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 }; }(), // 辨别移动终端的语言: zh-ch、en-us、ko-kr、ja-jp ... language: (navigator.browserLanguage || navigator.language).toLowerCase() } // 根据不同的终端,跳转到不同的地址 var theUrl = '默认下载地址'; if (Terminal.platform.android) { // 安卓下载地址 theUrl = '此次填写安卓下载地址' } else if (Terminal.platform.iPhone) { // 苹果下载地址 theUrl = '苹果下载地址'; } else if (Terminal.platform.iPad) { // 还可以通过Language,区分多国语言版 switch (Terminal.language) { case 'en-us': // 你的iPad APP (英文版) 对应下载地址: APP Store地址 theUrl = 'ipad'; break; case 'ko-kr': // 你的iPad APP (韩语版) 对应下载地址: APP Store地址 theUrl = ''; breakcase 'ja-jp': // 你的iPad APP (日文版) 对应下载地址: APP Store地址 theUrl = ''; breakdefault: // 你的iPad APP (中文-默认) 对应下载地址: APP Store地址 theUrl = ''; } } location.href = theUrl; </script> </head> <body> </body> </html>
  • 相关阅读:
    Debian ABC --- 1st time ---7
    django基础操作
    http协议
    css3种引入方式,样式与长度颜色,常用样式,css选择器
    前端3剑客
    视图,sql注入问题,事物,存储过程
    用户权限,pymysql
    表查询
    约束
    mysql数据类型
  • 原文地址:https://www.cnblogs.com/y896926473/p/5771011.html
Copyright © 2011-2022 走看看