Colin
Colin

Reputation: 2502

using $.support or $.browser to test for multiple browsers

What's the best way to find out if a user is not using IE 7 or 8, Firefox, Safari, Chrome or Opera?

I want to show a message if they are not using one those browsers. In this case is it just easier to use browser sniffing?

Upvotes: 0

Views: 186

Answers (2)

micmcg
micmcg

Reputation: 2390

What is your reason for doing this? If its to tell users with older browsers that they need to upgrade, then pick some features that your site needs in order to run smoothly, test for them, and if the tests fail, display the message. This way you aren't locked into hard coding a list of compliant browsers and when new versions/alternate browsers come out, they won't be lumped in the "bad browser" pool.

Upvotes: 0

meder omuraliev
meder omuraliev

Reputation: 186662

The problem is, in the future when a new browser is released and becomes more modern than those listed, your message will show up, I assume saying something to the effect of 'If you're not using X, you can't utilize all the benefits of this application' in which case I would advise you to not do this for that exact reason.

You won't always be around to support the application, and possibly won't account for other perfectly modern and valid user agents that use one of those engines such as Webkit but do not identify themselves as such.

Upvotes: 1

Related Questions