Skip to content

Instantly share code, notes, and snippets.

@furf
Forked from lifesinger/detect-ie.js
Created December 3, 2010 01:48
Show Gist options
  • Save furf/726451 to your computer and use it in GitHub Desktop.
Save furf/726451 to your computer and use it in GitHub Desktop.
/**
* modified from http://gist.github.com/527683
* only improve slightly to get small
*/
var ie = function(v, p, needle, undef) {
needle = p.getElementsByTagName('br');
while(
p.innerHTML = '<!--[if gt IE ' + (++v) + ']><br><![endif]-->',
needle[0]
);
return v > 4 ? v : undef;
}(3, document.createElement('p'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment