I was recently working on a project that had some issues in Firefox 2.0, but not Firefox 3.0. Generally I would frown on this sort of “browser sniffing” approach, but for this it was a requirement and there seemed to be no way around it.

I’ve used jQuery’s $.browser() method to add a class of ff2 to the <body> tag if the browser is indeed Firefox 2.0.

	if ($.browser.mozilla && $.browser.version.indexOf('1.8.') > -1) {

Hopefully this helps someone else out there!

About the Author

Kevin Leary is a freelance developer in Boston, MA with a strong portfolio of work, and over 13 years of experience as a programming consultant and digital strategy provider. Interested in working together? Hire me for your next project.