So I'm running jQuery 1.3.2 (yep it's old and right now I can't upgrade).
Problem is I'm trying to drop IE6 support for our internal site and upgrade the browser. I have this check
if($.browser.msie && $.browser.version=="6.0") {
// do something...
}
But during testing (some) Firefox users are seeing the do something
condition and should'nt be. Here are some of the User Agents that I think might be causing the issue.
- UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75 Safari/535.7
- UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.23) Gecko/20110920 Firefox/3.6.23
- UserAgent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75 Safari/535.7
- UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.25) Gecko/20111212 Firefox/3.6.25
- UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12
Is there more IE6 validation I need?
Note: The end user has no add-ons installed. I was thinking something like IE-Tabs could cause the issue but that's not the case
UPDATE:
All of the responses below lead me to this, still testing but it looks good. Any thoughs on how to improve it?
var ie6 = $.browser.msie && parseInt($.browser.version) === 6 && typeof window['XMLHttpRequest'] !== "object";
if(typeof document.body.style.maxHeight === "undefined" && ie6) {
alert('Your browser is IE6');
}
Related questions:
- jQuery detect IE6 using jQuery.support NOT jQuery.browser
- Detecting IE6 using jQuery.support