Modify ↓
Ticket #1015 (closed enhancement: fixed)
Add IE6 detection to $.browser
| Reported by: | joern | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.1.3 |
| Component: | core | Version: | 1.1.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description (last modified by brandon) (diff)
Mike proposed this implementation:
var b = navigator.userAgent.toLowerCase();
// Figure out what browser is being used
jQuery.browser = {
safari: /webkit/.test(b),
opera: /opera/.test(b),
msie: /msie/.test(b) && !/opera/.test(b),
msie6: /msie 6.0/.test(b) && !/opera/.test(b),
mozilla: /mozilla/.test(b) && !/(compatible|webkit)/.test(b)
};
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

If we need to add version detection, we should add it in a manner that is consistent across browsers and versions. Detecting IE6 is fundamentally the same as detecting IE7, 5, 8 or FF 1.0, so maybe we should provide a $.browser.version instead. I realize that $.browser.msie6 is way simpler than $.browser.msie && ($.browser.version == 6), but imagine how jQ source will look like when we add a variable for every major browser version.
By the way, is there any rational idea in syntax that looks like this? $("msie[@version=6]", $.browser) or $("mozilla[@version<1.5]", $.browser)