• css3 flex的IE8浏览器兼容问题


    我这是进行判断浏览器

    css判断ie版本才引用样式或css文件

    <!--[if !IE]><!--> 除IE外都可识别 <!--<![endif]-->
    <!--[if IE]> 所有的IE可识别 <![endif]-->
    <!--[if IE 6]> 仅IE6可识别 <![endif]-->
    <!--[if lt IE 6]> IE6以下版本可识别 <![endif]-->

    或者这样,直接解决:

    <!--判断IE浏览器版本-->
    <script>
        window.AESKey = '';
        // 判断浏览器是否支持placeholder属性
        function isSupportPlaceholder() {
            var input = document.createElement('input');
            return 'placeholder' in input;
        };
        (function() {
            //判断是否是IE浏览器,包括Edge浏览器
            function IEVersion() {
                //取得浏览器的userAgent字符串
                var userAgent = navigator.userAgent;
                //判断是否IE浏览器
                var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1;
                if (isIE) {
                    var reIE = new RegExp("MSIE (\d+\.\d+);");
                    reIE.test(userAgent);
                    var fIEVersion = parseFloat(RegExp["$1"]);
                    if (fIEVersion < 10 || !isSupportPlaceholder()) {
                        return true;
                    }
                } else {
                    return false;
                }
            }
            var tpl = [
                '<div class="browser-tips" style="margin:0 auto;text-align: center;">',
                '<img style="display: inline-block;margin:100px 0 20px 0;" src="error.png">',
                '<p style="font-size: 20px;color:#000;line-height: 32px;">为了给您提供更优质的网页浏览体验,建议使用IE10及以上版本的浏览器</p>',
                '<p style="font-size: 20px;color:#000;line-height: 32px;">对“本网站”进行访问,请升级或更换其他浏览器</p>',
                '</div>'
            ].join('');
    
            window.onload = function() {
                if (IEVersion()) {
                    document.write(tpl);
                }
            };
            window.siteName = "本网站好啊好啊";
        })();
    </script>
  • 相关阅读:
    [转载]JavaScript世界的一等公民 函数
    JavaScript基础知识词法结构
    JavaScript触发asp.net服务器端控件事件
    WinForm窗体间传值大全
    快速导入Excel
    让虚拟机支持USB HDD 启动
    常见的mysql导出excel工具介绍
    silverlight 播放器,丑丑版
    快速导出Excel
    一个C#编写QQ接口软件QQ协议(转)
  • 原文地址:https://www.cnblogs.com/init-007/p/11533654.html
Copyright © 2020-2023  润新知