title: IE 10 crashes when script is loaded, unless a delay is introduced
body: <p>I recently learned that the app I'm working on frequently crashes Internet Explorer 10 - no error messages, just Windows' "The application stopped working". Looking at the Event Viewer shows what I gather is a null reference in mshtml.dll:</p>
  
  <pre><code>Faulting application name: iexplore.exe, version: 10.0.9200.17267, time stamp: 0x54e7f156
  Faulting module name: MSHTML.dll, version: 10.0.9200.17267, time stamp: 0x54e803bf
  Exception code: 0xc0000005
  Fault offset: 0x004f9b17
  Faulting process id: 0xeec
  Faulting application start time: 0x01d0657e1d8a29f6
  Faulting application path: C:\Program Files\Internet Explorer\iexplore.exe
  Faulting module path: C:\Windows\system32\MSHTML.dll
  </code></pre>
  
  <p>I've discovered that this happens when loading the first script on the page, which is jQuery. I've tried two different versions: 1.10.2 and 1.11.2, with the same result.</p>
  
  <p>It turns out that introducing a small delay before loading jQuery (and the rest of the scripts) solves the issue. I've added this snippet before all other scripts:</p>
  
  <pre><code>if (navigator.userAgent.indexOf('MSIE 10') &gt;= 0) {
      var t = new Date().getTime();
      while (new Date().getTime() - t &lt; 300);
  }
  </code></pre>
  
  <p>This seemingly solves the problem. However, it is clearly very inelegant and I still don't know what the actual problem is.</p>
  
  <p>Has anyone experienced something similar, and is there a better solution?</p>