IE Version Check

Benchmark created by shawndumas on


Preparation HTML

<script>
  var ie = '';
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Conditional Comment
ie = (function() {
 var v = 3,
     div = document.createElement('div');

 while (
 div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->', div.getElementsByTagName('i')[0]);
 window.status = v;

 return (v > 4) ? v : false;
})();
ready
Conditional Compilation
ie = ( /*@cc_on!@*/ false) && (parseInt(navigator.userAgent.match(/msie\s(\d+)/i)[1]));
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.

  • Revision 1: published by shawndumas on