, LLC.

How To Target Firefox  2

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!

Meet the Author

Kevin Leary, WordPress Consultant

I'm a freelance web developer and WordPress consultant in Boston, MA with 16 years of experience building websites and applications. View a portfolio of my work or request an estimate for your next project.