29 June 2011

How to use (or detect) browser name in JQuery ?

Solution works in jQuery 1.6.1 (It should works from jQuery 1.1.3 or at least 1.4 (in 1.4 they changed way of detect browsers based on webkit engine like Mozilla, Chrome ,but I am too lazy bastard to check this out,sorry)

For some mysterious reasons jQuery doesn't offer property name for browser which should looks as simple as   $.browser.name  but NO. jQuery doesn't offer that , so what to do ?
use this piece of code instead:

jQuery.uaMatch(navigator.userAgent).browser 

No comments:

Post a Comment