Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you want to detect the browser you're working with, IE has a special feature, called conditional compilation - <a href="http://www.javascriptkit.com/javatutors/conditionalcompile.shtml" rel="noreferrer">http://www.javascriptkit.com/javatutors/conditionalcompile.shtml</a></p> <p>To get the version, you'd use <code>@_jscript_version</code>. So in Javascript, I'd use:</p> <pre><code>&lt;script type="text/javascript"&gt; var isIE10 = false; /*@cc_on if (/^10/.test(@_jscript_version)) { isIE10 = true; } @*/ console.log(isIE10); &lt;/script&gt; </code></pre> <p>I don't have IE10, but when testing with IE9, it seems to work. If I change the browser mode to 7 or 8, <code>@_jscript_version</code> has the true browser JScript version (it stays as <code>9</code> in my case).</p> <p>To see the list of JScript versions, you can see them here - <a href="http://en.wikipedia.org/wiki/JScript#Versions" rel="noreferrer">http://en.wikipedia.org/wiki/JScript#Versions</a> . It doesn't list IE10, but I'd assume it's 10. Before IE9, they used numbers inconsistent with the browser version, but are possibly on the right track since 9. You'll have to see what <code>@_jscript_version</code> is by default for 10, but I'd assume it starts with "10" and has a minor version possibly.</p> <hr> <p><strong>UPDATE:</strong></p> <p>To avoid minification of comments, you can use something like:</p> <pre><code>var IE = (function () { "use strict"; var ret, isTheBrowser, actualVersion, jscriptMap, jscriptVersion; isTheBrowser = false; jscriptMap = { "5.5": "5.5", "5.6": "6", "5.7": "7", "5.8": "8", "9": "9", "10": "10" }; jscriptVersion = new Function("/*@cc_on return @_jscript_version; @*/")(); if (jscriptVersion !== undefined) { isTheBrowser = true; actualVersion = jscriptMap[jscriptVersion]; } ret = { isTheBrowser: isTheBrowser, actualVersion: actualVersion }; return ret; }()); </code></pre> <p>And access the properties like <code>IE.isTheBrowser</code> and <code>IE.actualVersion</code> (which is translated from internal values of JScript versions).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload