Skip to content

Instantly share code, notes, and snippets.

@motss
Last active March 24, 2016 12:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save motss/c6f4f7d0c3baf14c2176 to your computer and use it in GitHub Desktop.
Save motss/c6f4f7d0c3baf14c2176 to your computer and use it in GitHub Desktop.
Feature detection for IEs
// http://stackoverflow.com/questions/10964966/detect-ie-version-prior-to-v9-in-javascript
// http://tanalin.com/en/articles/ie-version-js/
var ie = (function (){
if (window.ActiveXObject === undefined) return null;
if (!document.querySelector) return 7;
if (!document.addEventListener) return 8;
if (!window.atob) return 9;
if (!document.__proto__) return 10;
return 11;
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment