Note that there are some explanatory texts on larger screens.

plurals
  1. PODid IE11 remove javascript conditional compilation?
    primarykey
    data
    text
    <p>I have been determining the version of the IE Trident engine using <a href="http://msdn.microsoft.com/en-us/library/ie/121hztk3%28v=vs.94%29.aspx" rel="nofollow noreferrer">javascript conditional compilation</a>:</p> <pre><code>var ieVersion = undefined; /*@cc_on ieVersion = Math.floor(@_jscript_version); @*/ </code></pre> <p>This worked fine for IE8, 9 and 10. In IE11, the conditionally-commented block does not execute, <em>unless</em> I use the F12 dev tools to emulate IE10 (in which case it returns the correct value, 11).</p> <p>This is confusing, since the <a href="http://msdn.microsoft.com/en-us/library/ie/121hztk3%28v=vs.94%29.aspx" rel="nofollow noreferrer">MSDN page on conditional compilation</a> <em>specifies that it applies to Internet Explorer 11</em>. (<strong>UPDATE 2015-02-03</strong>: this page has since been updated to explicitly state that its content <em>does not</em> apply to IE11 in standards mode.) I've <a href="https://www.google.com/search?q=ie11+javascript+conditional+compilation" rel="nofollow noreferrer">not found any information online</a> to suggest that IE11 should not support conditional comments.</p> <p>Does anyone have any information about this? Can anyone reproduce this behaviour in IE11?</p> <hr> <p>Edit: the relevance of this is in IE's <code>&lt;audio&gt;</code> support. I have a web app that requires playback of around 50 short (~1sec) audio files, which should be played in a (pseudo-)random order, and individually after user interaction. The problems are various:</p> <ul> <li>IE9 has an undocumented limit of 41 <code>audio</code> elements (whether declared in HTML or as JS objects). All subsequent audio files silently fail to load and play. (Each of the 41 elements can have its source re-assigned, but every second re-assignment also fails silently. I would love to see the code behind these bugs...)</li> <li>IE10 and IE11 "stutter" when playing short sounds: they play a fraction of a second, then pause, then continue on. The effect to the end-user is that the audio is unintelligible. (The <code>audio</code>s have <code>preload="auto"</code> and report a non-zero buffer.)</li> </ul> <p>Naturally there's no practical way to feature-detect these issues, hence the browser-detect. I generally feel user-agent sniffing is too dicey for production code; the <code>@cc_on</code> technique seemed more robust.</p> <p>My workaround for IE9 is to serialise the app state to <code>sessionStorage</code> after the 25th sound, then reload the page and deserialise.</p> <p>In IE10/11, my workaround is to play the last 90% of the audio at 0 volume, which seems to force IE to <em>actually</em> buffer the file.</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.
 

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