zoukankan      html  css  js  c++  java
  • 判断苹果和安卓端或者wp端

    window.onload = function() {

    var u = navigator.userAgent;

    if(u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) { //安卓手机

    //执行安卓的

    //alert("azsj");

    // window.location.href = "mobile/index.html";

    } else if(u.indexOf('iPhone') > -1) { //苹果手机

    //执行苹果的

    // window.location.href = "mobile/index.html";

    //alert("pgsj");

    } else if(u.indexOf('Windows Phone') > -1) { //winphone手机

    alert("WP版暂未开发!");

    // window.location.href = "mobile/index.html";

    }

    }

  • 相关阅读:
    P1064 金明的预算方案
    P1164 小A点菜
    P1346 电车
    01背包二进制优化
    2018暑期多校1
    牛课第二次多校I
    STL
    Reachability from the Capital
    P2921 [USACO08DEC]在农场万圣节Trick or Treat on the Farm
    P3387 【模板】缩点
  • 原文地址:https://www.cnblogs.com/chengmingxiaowu/p/7597925.html
Copyright © 2011-2022 走看看