Bug Tracker

Modify

Ticket #1015 (closed enhancement: fixed)

Opened 6 years ago

Last modified 14 months ago

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

comment:1 Changed 6 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 6 years ago by brandon

  • need set to Review
  • Status changed from new to closed
  • Resolution set to fixed
  • Description modified (diff)

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

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.