如果IE标签不能正常工作。

时间:2021-05-22 22:44:32

I have this HTML

我有这个HTML

  <script>
    internet_explorer = false;
  </script>
  <!--[if IE]>
    <script type="text/javascript">
      internet_explorer = true;
    </script>
  <![endif]-->

and this JS:

这JS:

console.log(internet_explorer)

When I run this on all browsers it should be false and it is. However, it is supposed to be true on Internet Explorer but it's false. What do I do wrong?

当我在所有浏览器上运行时,它应该是错误的。然而,它应该是在Internet Explorer上是正确的,但它是错误的。我做错了什么?

1 个解决方案

#1


1  

Conditional comments are no longer supported

条件注释不再被支持。

Support for conditional comments has been removed in Internet Explorer 10 standards and quirks modes for improved interoperability and compliance with HTML5.

在Internet Explorer 10标准和quirks模式中已经删除了对条件注释的支持,以提高互操作性和对HTML5的兼容性。

Source: https://msdn.microsoft.com/en-us/library/hh801214(v=vs.85).aspx

来源:https://msdn.microsoft.com/en-us/library/hh801214(v = vs.85). aspx

#1


1  

Conditional comments are no longer supported

条件注释不再被支持。

Support for conditional comments has been removed in Internet Explorer 10 standards and quirks modes for improved interoperability and compliance with HTML5.

在Internet Explorer 10标准和quirks模式中已经删除了对条件注释的支持,以提高互操作性和对HTML5的兼容性。

Source: https://msdn.microsoft.com/en-us/library/hh801214(v=vs.85).aspx

来源:https://msdn.microsoft.com/en-us/library/hh801214(v = vs.85). aspx