After the release of jQuery 1.3 the $.browser method was deprecated as there was a concensus that we shouldn’t be sniffing for browser brands/versions but instead for what features they do or don’t support.
Whilst this is agreable, there are some scenarios where your objective is in fact to state the browser in use.
I am working on one of those scenarios at present. We have an application that currently is only available in Internet Explorer. The application has been rebuilt to work with multiple browsers and really that should be job done. However, we want to test against the uptake of the new interface so want to allow users to rollback similar to Twitter.
This has 1 draw back for us; you can’t rollback outside IE.
Using the jQuery.support properties, you can test to see which browser vendor is in use, here’s how. Continue reading