Created
May 17, 2011 02:23
-
-
Save Takazudo/975771 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* browser sinffing | |
* http://james.padolsey.com/javascript/detect-ie-in-js-using-conditional-comments/ | |
*/ | |
(function(){ | |
var ie = (function(){ | |
var undef, | |
v = 3, | |
div = document.createElement('div'), | |
all = div.getElementsByTagName('i'); | |
while ( | |
div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->', | |
all[0] | |
); | |
return v > 4 ? v : undef; | |
}()); | |
/* jQuery interface */ | |
$.browser.ie6 = (ie === 6); | |
$.browser.ielt7 = (ie < 7); | |
$.browser.ie7 = (ie === 7); | |
$.browser.ielt8 = (ie < 8); | |
$.browser.ie8 = (ie === 8); | |
$.browser.ielt9 = (ie < 9); | |
$.browser.ie9 = (ie === 9); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment