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';
    }

  • 相关阅读:
    c++ 输出 变量名 字符串(zz.is2120.BG57IV3)
    分页存储过程
    连接字符串
    动软 DBHeper 完全代码
    java 数据库连接字符串
    DOS命令行下常见的错误信息
    点击单元格选择整行,又可编辑单元格
    label里文字中的下划线
    Delphi程序中动态生成控件的方法及应用
    双击dbgrid排序的问题
  • 原文地址:https://www.cnblogs.com/zhangweixin/p/4843706.html
Copyright © 2011-2022 走看看