• JS客户端判断


    <script language="javascript" type="text/javascript">

            function browserDetection(){

                  var userAgent=window.navigator.userAgent.toLowerCase();

                  var browser=null;

                  if(userAgent.match(/ipad/i)){browser='ipad';

                  }else if(userAgent.match(/iphone os/i)){browser='iphone';

                  }else if(userAgent.match(/midp/i)){browser='midp'   

                  }else if(userAgent.match(/rv:1.2.3.4/i)){browser='rv:1.2.3.4';

                  }else if(userAgent.match(/ucweb/i)){browser='ucweb';

                  }else if(userAgent.match(/android/i)){browser='android';

                  }else if(userAgent.match(/windows ce/i)){browser='windowsCe';

                  }else if(userAgent.match(/windows mobile/i)){browser='windowsMobile'; 

                  }else{browser='PC' 

                  }

                  return browser;

           }

    if(browserDetection()!="PC"){alert("不是PC端")

    }else{alert("是PC端")}

    </script>

  • 相关阅读:
    Django的templates(模板)
    Django的urls(路由)
    Markdown中实现折叠代码块
    图片上传2
    Comparator 排序
    Serializable 序列化为文件
    统计连续签到的方法
    Serializable 序列化为字符串 base64
    Serializable 序列化使用限制
    Serializable 剔除某些不想保存的字段 transient
  • 原文地址:https://www.cnblogs.com/ranyonsue/p/5532049.html
Copyright © 2020-2023  润新知