Search code examples
javascriptinternet-explorertinymceinternet-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. This works quite well with conditinal comments for IE9 and for IE11 and upper. 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)?


Solution

  • You won't be able to use conditional comments for this in IE10 and 11 - they're deprecated as of IE10.

    Your best bet would be to RegEx the user agent string.