Bug Tracker

Opened 16 years ago

Closed 16 years ago

Last modified 11 years ago

#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:
Blocked by: Blocking:

Description (last modified by brandon)

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 (2)

comment:1 Changed 16 years ago by rrudenko

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)

comment:2 Changed 16 years ago by brandon

Description: modified (diff)
need: Review
Resolution: fixed
Status: newclosed

This is now fixed in SVN with the addition of a version property to the browser object.

Note: See TracTickets for help on using tickets.