简体   繁体   English

如何为脚本标签检测Internet Explorer 10?

[英]How to detect Internet Explorer 10 for script tags?

Currently I am trying to load the legacy version of TinyMCE when an older version of Internet Explorer is discovered. 当前,当我发现旧版本的Internet Explorer时,我正在尝试加载TinyMCE的旧版本。 This works quite well with conditinal comments for IE9 and for IE11 and upper. 这对于IE9和IE11及更高版本的连续注释非常有效。 Example: 例:

<head>
  <!-- IE9 and lower -->
  <!--[if lte IE 9]>
  <script src="/script/libs/tinymce-legacy/tinymce.min.js"></script>
  <![endif]-->
  <!-- IE10 doesn't work :( -->
  <!-- IE11 and upper -->
  <!--[if gte IE 11]><!-->
  <script src="/script/libs/tinymce/tinymce.min.js"></script>
  <!--<![endif]-->
</head>

Is there a possibility to detect IE10 while using script tags (maybe even without javascript)? 是否有可能在使用脚本标签时检测IE10(甚至没有JavaScript)?

You won't be able to use conditional comments for this in IE10 and 11 - they're deprecated as of IE10. 在IE10和11中,您将无法使用条件注释-自IE10起,它们已被弃用。

Your best bet would be to RegEx the user agent string. 最好的选择是使用RegEx用户代理字符串。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM