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";

    }

    }

  • 相关阅读:
    Dos命令%date:~0,10%
    SharePoint显示错误信息
    VM打开虚拟机文件报错
    Sharepoint2013切换用户菜单
    批量创建域用户
    通过数据库恢复SharePoint网站
    SharePoint2013修复报错
    js 循环
    js 正则表达式
    阶乘函数
  • 原文地址:https://www.cnblogs.com/chengmingxiaowu/p/7597925.html
Copyright © 2011-2022 走看看