{"id":707,"date":"2014-06-29T14:17:56","date_gmt":"2014-06-29T14:17:56","guid":{"rendered":"http:\/\/blog.silverterra.net\/?p=707"},"modified":"2014-06-29T20:30:59","modified_gmt":"2014-06-29T20:30:59","slug":"detect-the-ie-version-on-the-client-side","status":"publish","type":"post","link":"https:\/\/blog.silverterra.net\/?p=707","title":{"rendered":"detect the ie version on the client side"},"content":{"rendered":"<blockquote><p>Goal: feature specific ie version detection<\/p><\/blockquote>\n<p>I&#8217;ve found somewhere a tricky solution for this problem. Here is a little bit modified version of that:<\/p>\n<pre data-enlighter-language=\"js\" class=\"EnlighterJSRAW\">\r\n\/\/ ie version detector\r\nvar isIE = (function() {\r\n  var undef,\r\n      v = 3,\r\n      span = document.createElement('span');\r\n  while (\r\n    span.innerHTML = '&lt;!--[if gt IE ' + (++v) + ']&gt;.&lt;![endif]--&gt;',\r\n    span.innerHTML[0] == '.'\r\n  );\r\n  v = !!navigator.appVersion.match(\/MSIE 10\/) ? 10 : v;\r\n  v = !!window.MSInputMethodContext ? 11 : v;\r\n\r\n  return v &gt; 4 ? v : undef;  \r\n}());\r\n<\/pre>\n<p>The isIE variable will be the version number if we have an internet explorer in other cases this variable will be <code data-enlighter-language=\"js\" class=\"EnlighterJSRAW\">undefined<\/code>.<br \/>\nThe original method not working above ie9, that&#8217;s why I put a simple ie10 detection based on the navigator version and a feature detection to the ie11. !!window.MSInputMethodContext will be true in ie11!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Goal: feature specific ie version detection I&#8217;ve found somewhere a tricky solution for this problem. Here is a little bit modified version of that: The isIE variable will be the version number if we have an internet explorer in other cases this variable will be . The original method not working above ie9, that&#8217;s why [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-707","post","type-post","status-publish","format-standard","hentry","category-web-trick"],"_links":{"self":[{"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/posts\/707","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=707"}],"version-history":[{"count":2,"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/posts\/707\/revisions"}],"predecessor-version":[{"id":709,"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/posts\/707\/revisions\/709"}],"wp:attachment":[{"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=707"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=707"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=707"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}