Skip to content

Instantly share code, notes, and snippets.

@anhr
anhr / ie-6-9-detect.js
Last active August 29, 2015 14:26 — forked from jalbertbowden/ie-6-9-detect.js
JavaScript IE Version Detection, IE6-10 and IE Mobile
// ----------------------------------------------------------
// A short snippet for detecting versions of IE:
// Uses a combination of object detection and user-agent
// sniffing.
// ----------------------------------------------------------
// If you're not in IE then:
// ie === NaN // falsy
// If you're in IE then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE: