zoukankan      html  css  js  c++  java
  • h5 js判断是安卓还是ios设备,跳转到对应的下载地址

    /*ios和安卓跳转 js*/
    $(function(){
    var u = navigator.userAgent;
    var ua = navigator.userAgent.toLowerCase();
    var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
    var isiOS = !!u.match(/(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
    if(ua.match(/MicroMessenger/i)=="micromessenger") { //微信内置浏览器+应用宝链接
    $(".go").bind('touchstart', function (event) {
       //跳转到下载地址 这块我写的是安卓下载地址
    window.location.href='http://tstatics.iyuwan.com/files/apk/201605/Iyuwan.apk'
    });
    }else{
    if(isiOS){
    $(".go").bind('touchstart', function (event) {
                   //跳转到ios下载地址 
                    window.location.href='https://appsto.re/cn/KG6P2.i'

    });
    }else if(isAndroid){
    $(".go").bind('touchstart', function (event) {
    window.location.href='http://tstatics.iyuwan.com/files/apk/201605/Iyuwan.apk'
    });
    }else{ //PC 端
    $(".go").click(function(){
                    //跳转到andriod下载地址 
                    window.location.href='http://tstatics.iyuwan.com/files/apk/201605/Iyuwan.apk'
    });
    }

    }

    });
    Lyn小娜签名:聪明出于勤奋,天才在于积累。
  • 相关阅读:
    css 定位
    css inline忽略宽和高
    css clear属性
    关系型数据库与nosql
    链接标签<a>的css定义规则
    1em=16px
    text-align的justify属性
    2393Cirno的完美算数教室 容斥
    bzoj4665小w的喜糖 dp+容斥
    bzoj4558[JLoi2016]方 容斥+count
  • 原文地址:https://www.cnblogs.com/lynna/p/6894960.html
Copyright © 2011-2022 走看看