• h5页面多端判断


      var u = navigator.userAgent,
        isAndroid = (u.indexOf('Android') > -1 || u.indexOf('Adr') > -1) ? true : false,
        isiOS = (u.indexOf('iPhone') > -1 || u.indexOf('iPad') > -1) ? true : false,
        isWeiXin = (u.toLowerCase().match(/MicroMessenger/i) == 'micromessenger') ? true : false,
        url = window.location.href,
        isinApp = (url.toLowerCase().indexOf("isinapp") > -1) ? true : false,
        firsturl = window.location.origin + "/",
        xqid = window.location.pathname.slice(7, -5),
        number_stId = window.location.pathname.indexOf("-goods");
      stId = window.location.pathname.slice(7, number_stId), opendappurl = '', scrchStr = '', time = new Date() * 1, session = window.sessionStorage, ifr = window.document.createElement("iframe");

      if (isAndroid) {
        //安卓嵌套
      } else if (isiOS) {
        //苹果嵌套
      };
      if (!isinApp) {//非小程序
        if (!isWeiXin) {//非微信
          if (isAndroid) {//非安卓
           
          } else if (isiOS) {//非iops

          };
        };
      };
  • 相关阅读:
    PHP计算近1年的所有月份
    mysql的索引和锁
    深度解析 https 协议
    linux 常用命令大全
    为什么Python3.6字典变得有序了?
    oddo
    RESTful接口开发规范
    python中的 __inti__ 和 __new__ 方法的区别
    十大经典算法 Python实现
    MongoDB journal 与 oplog,究竟谁先写入?--转载
  • 原文地址:https://www.cnblogs.com/iqiao/p/12488901.html
Copyright © 2020-2023  润新知