zoukankan      html  css  js  c++  java
  • 判断设备

    var ua = navigator.userAgent.toLowerCase();    
        if (/iphone|ipad|ipod/.test(ua)) {
                //alert("iphone");        
        } else if (/android/.test(ua)) {
                alert("android");    
        }
    /*判断设备*/
    var ss = navigator.userAgent.toLowerCase();
    
    if(ss.indexOf("fhmall_android") > 0) {
        native_flag = 0;
    } else if(ss.indexOf("fhmall_ios") > 0) {
        native_flag = 1;
    } else {
        native_flag = -1;
    }
    if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
        //alert(navigator.userAgent);  
        window.location.href ="iPhone.html";
    } else if (/(Android)/i.test(navigator.userAgent)) {
        //alert(navigator.userAgent); 
        window.location.href ="Android.html";
    } else {
        window.location.href ="pc.html";
    };
    if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
                    window.location.href ="https://itunes.apple.com/cn/app/1hao-yao-dian/id727578007?mt=8";
            } else if (/(Android)/i.test(navigator.userAgent)) {
                    window.location.href ="https://itunes.apple.com/cn/app/1hao-yao-dian/id727578007?mt=8";
            } else {
                     window.location.href ="http://www

    http://caibaojian.com/browser-ios-or-android.html

  • 相关阅读:
    yii修改密码 弹出修改成功提示(八)
    yii模型规则的简单使用以及开启前端的验证(七)
    利用ab测试并发可靠么
    yii数据库链接(六)
    初始化collectionViewCell
    监听事件
    ControllerEvent
    代码构建视图
    DeveloperAppleHelp
    Xcode 小技巧
  • 原文地址:https://www.cnblogs.com/xiangru0921/p/6709612.html
Copyright © 2011-2022 走看看