zoukankan      html  css  js  c++  java
  • js判断浏览器

    if (navigator.userAgent.indexOf("Opera") != -1) {
    // document.write('您的浏览器是Opera吧?');
    window.location.href = '/LoginMore.aspx';
    }
    // 包含「MSIE」文字列
    else if (navigator.userAgent.indexOf("MSIE") != -1) {
    // document.write('您的浏览器是Internet Explorer吧?');
    window.location.href = '/Login.aspx';
    }
    else if (navigator.userAgent.indexOf('Trident') > -1 && navigator.userAgent.indexOf('rv:11') > -1) {
    //alert('IE11');
    window.location.href = '/Login.aspx';
    } else if (navigator.userAgent.indexOf('MSIE') > -1 && navigator.userAgent.indexOf('Trident') > -1) {

    // alert('IE8-10');
    window.location.href = '/Login.aspx';
    } else if (navigator.userAgent.indexOf('MSIE') > -1) {
    //browser_name='IE(6-7)';
    // alert(6 - 7);
    window.location.href = '/Login.aspx';
    }
    // 包含「Firefox」文字列
    else if (navigator.userAgent.indexOf("Firefox") != -1) {
    // document.write('您的浏览器时Firefox吧?');
    window.location.href = '/LoginMore.aspx';
    }
    // 包含「Netscape」文字列
    else if (navigator.userAgent.indexOf("Netscape") != -1) {
    // document.write('您的浏览器时Netscape吧?');
    window.location.href = '/LoginMore.aspx';
    }
    // 包含「Safari」文字列
    else if (navigator.userAgent.indexOf("Safari") != -1) {
    // document.write('您的浏览器时Safari 吧?');
    window.location.href = '/LoginMore.aspx';
    }
    else {
    // document.write('无法识别的浏览器。');
    window.location.href = '/LoginMore.aspx';
    }

  • 相关阅读:
    原生内存泄漏检测
    安卓适配
    游戏里的动态阴影-ShadowMap实现原理
    游戏里的跨地图寻路算法
    Unity-Shader-动态阴影(上) 投影的矩阵变换过程
    Unity-奥义技能背景变黑效果
    UGUI学习笔记
    Unity-Shader-镜面高光Phong&BlinnPhong-油腻的师姐在哪里
    Unity-Shader-光照模型之漫反射
    Unity3D-Shader-热扭曲效果
  • 原文地址:https://www.cnblogs.com/zhangweixin/p/4843706.html
Copyright © 2011-2022 走看看