标签: internet-explorer-11

如何检测IE11?

当我想检测IE时,我使用此代码:

function getInternetExplorerVersion()
{
  var rv = -1;
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}
function checkVersion()
{
  var msg = "You're not using Internet Explorer.";
  var ver = getInternetExplorerVersion();

  if ( ver > -1 )
  {
    msg = "You are using IE " + ver;
  }
  alert( msg );
}
Run Code Online (Sandbox Code Playgroud)

但IE11正在返回"你没有使用Internet Explorer".我该如何检测它?

debugging internet-explorer browser-detection forward-compatibility internet-explorer-11

207
推荐指数
7
解决办法
22万
查看次数

如何为IE 11编写CSS hack?

我怎样才能为IE 11破解或编写CSS?我有一个在IE 11中看起来很糟糕的网站.我只是在这里搜索,但还没有找到任何解决方案.

有没有css选择器?

css css-selectors css-hack internet-explorer-11

190
推荐指数
5
解决办法
35万
查看次数

IE10中的滚动条覆盖,你如何阻止?

在IE10中,滚动条并不总是存在...当它出现时它作为一个叠加...它是一个很酷的功能但我想关闭我的特定网站,因为它是一个全屏应用程序和我的徽标和菜单背后都丢失了.

IE10:

在此输入图像描述

铬:

在此输入图像描述

任何人都知道在IE10上始终将滚动条固定到位的方法吗?

overflow-y:滚动似乎不起作用!它只是将它永久地放在我的网站上.

它可能是导致问题的引导,但我不知道哪个部分!看这里的例子:http://twitter.github.io/bootstrap/

html css scrollbar internet-explorer-10 internet-explorer-11

182
推荐指数
4
解决办法
8万
查看次数

IE11 - 对象不支持属性或方法'includes' - javascript window.location.hash

我正在检查网址,看它是否包含或包含?在其中控制窗口中的哈希弹出状态.所有其他浏览器只有IE的问题.

当我尝试以这种方式加载时,调试器给我这个错误Object不支持属性或方法'includes'

当我通过popstate加载页面时,我没有收到任何错误

    $(document).ready(function(e) {
        if(window.location.hash) {
            var hash;
            if(window.location.hash.includes("?")) {
                alert('I have a ?');
                hash = window.location.hash.substring(window.location.hash.indexOf('#') + 0,window.location.hash.indexOf('?'));
            }else {
                hash = window.location.hash;
            };
            if (hash=="#DRS" || hash=="#DRP" || hash=="#DFFI" || hash=="#DCI" || hash=="#DCP" || hash=="#DRP" || hash=="#DRMA" || hash=="#EICS" || hash=="#ORG"){
                $(hash+'Content').addClass('pageOn').removeClass('pageOff');
            }else {
                $('#homeContent').addClass('pageOn').removeClass('pageOff');
            };
        } else {
            $('#homeContent').addClass('pageOn').removeClass('pageOff');
        }
        $(window).on('popstate', function() {
            var hash;
            if(window.location.hash.includes("?")) {
                hash = window.location.hash.substring(window.location.hash.indexOf('#') + 0,window.location.hash.indexOf('?'));
            }else {
                hash = window.location.hash;
            };
            if (hash=="#DRS" || hash=="#DRP" || hash=="#DFFI" || hash=="#DCI" …
Run Code Online (Sandbox Code Playgroud)

javascript internet-explorer-11 ecmascript-7

168
推荐指数
5
解决办法
13万
查看次数

Flex容器中的文本不会在IE11中换行

请考虑以下代码段:

.parent {
  display: flex;
  flex-direction: column;
  width: 400px;
  border: 1px solid red;
  align-items: center;
}
.child {
  border: 1px solid blue;
}
Run Code Online (Sandbox Code Playgroud)
<div class="parent">
  <div class="child">
    Lorem Ipsum is simply dummy text of the printing and typesetting industry
  </div>
  <div class="child">
    Lorem Ipsum is simply dummy text of the printing and typesetting industry
  </div>
</div>
Run Code Online (Sandbox Code Playgroud)

在Chrome中,文本按预期包装:

在此输入图像描述

但是,在IE11中,文本没有包装:

在此输入图像描述

这是IE中的已知错误吗?(如果是,将指示指针)

有一个已知的解决方法吗?


这个类似的问题没有明确的答案和官方指针.

css internet-explorer css3 flexbox internet-explorer-11

153
推荐指数
4
解决办法
8万
查看次数

如何从Internet Explorer 11降级到Internet Explorer 10?

作为开发人员,我发现新的Internet Explorer版本是一个完整的噩梦.我关闭了Windows功能,但我无法安装Internet Explorer 10.它说它已经安装了它不是.是否有我应删除的文件或注册表项?

internet-explorer internet-explorer-11

147
推荐指数
2
解决办法
105万
查看次数

如何在IE11中恢复"浏览器模式"?

更新:旧问题仅适用于IE11预览; 浏览器模式已在IE11的最终版本中返回.但有一个问题:它是无用的,因为它不会模仿条件评论.例如,如果您使用它们在旧版IE中启用HTML5支持,您将无法再在IE11中调试您的站点.

        <!--[if lte IE 8]>
            <script src="html5shiv.js"></script>
        <![endif]-->
Run Code Online (Sandbox Code Playgroud)

阅读另一个StackOverflow问题和IE 错误跟踪器问题.微软从未对此作出回应,因此看起来他们故意引入这个漏洞来引导人们购买BrowserStack订阅.有条件的评论模拟在预览版中运行得很好.

原始问题:在Windows 7上安装IE11预览版时,它附带了老式的F12工具,可以更改浏览器模式. 在此输入图像描述

但是,如果您转到"工具"菜单并选择"F12"开发人员工具,它将被新的开发人员工具取代,并且"浏览器模式"不再可用. 在此输入图像描述

将其恢复的唯一方法是卸载IE11并重新安装它.

是否有更简单的方法在IE11中切换浏览器模式?

cross-browser ie-developer-tools internet-explorer-11

131
推荐指数
4
解决办法
27万
查看次数

Internet Explorer 9,10和11事件构造函数不起作用

我正在创建一个事件,所以使用DOM Event构造函数:

new Event('change');
Run Code Online (Sandbox Code Playgroud)

这在现代浏览器中工作正常,但在Internet Explorer 9,10和11中,它失败了:

Object doesn't support this action
Run Code Online (Sandbox Code Playgroud)

如何修复Internet Explorer(理想情况下通过polyfill)?如果我不能,是否有可以使用的解决方法?

custom-events dom-events internet-explorer-9 internet-explorer-10 internet-explorer-11

119
推荐指数
2
解决办法
5万
查看次数

为什么Internet Explorer 11即使在模拟Internet Explorer 8文档模式时也不尊重条件注释?

我正在使用新的Internet Explorer 11开发人员工具将文档模式切换为"8",但条件注释仍然被忽略,即它们未被正确解析并且表现得像普通注释.因此,浏览器不会请求/加载条件注释中的任何引用文件.

为什么会这样?这是一个错误吗?

如果您认为这确实是一个需要修复的错误,请进入并说您也可以在针对此问题报告的Microsoft错误报告中重现此问题:
通过F12 Developer模拟文档模式时,条件注释不起作用工具.

更新:已报告此问题已在上述错误报告中修复.

browser internet-explorer conditional-comments internet-explorer-11 ie11-developer-tools

111
推荐指数
5
解决办法
4万
查看次数

Internet Explorer 11检测

我知道IE 11具有与所有其他IE不同的用户代理字符串

 Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv 11.0) like Gecko
Run Code Online (Sandbox Code Playgroud)

我试图用这个问题的答案检测IE 11'

Jquery无法检测到IE 11

那是 !!navigator.userAgent.match(/Trident\/7\./)

但我收到了错误 Object not found and needs to be re-evaluated.

然后我在IE11中打开开发者控制台并尝试访问一些预定义的javascript对象,我仍然得到相同的错误.

我试过了

navigator.userAgent

window.navigator

console.log('test');

有人对此有任何想法吗?

javascript internet-explorer internet-explorer-11

107
推荐指数
7
解决办法
13万
查看次数