ua-ie6

Benchmark created by 祁涛 on


Description

var isIE6 = typeof window.addEventListener == 'undefined' && typeof document.documentElement.style.maxHeight == 'undefined';

vs

var isIE6 = $.browser.msie && $.browser.version < 7 ? true : false;

Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
DOM hack
var isIE6 = typeof window.addEventListener == 'undefined' && typeof document.documentElement.style.maxHeight == 'undefined';


 
ready
userAgent by jQuery
var isIE6 = $.browser.msie && $.browser.version < 7 ? true : false;
ready
userAgent by pure javascript
var isIE6 = (navigator.userAgent.indexOf( 'MSIE 6' ) !== -1) ? true : false; 
ready

Revisions

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

  • Revision 1: published by 祁涛 on