Get browser info using jquery

jQuery.browser

$.browser
$.browser.version
The $.browser property provides information about the web browser.
Available flags are:
  • webkit (as of jQuery 1.4)
  • safari (deprecated)
  • opera
  • msie
  • mozilla
Example: Returns true if IE
if ($.browser.msie) {
alert( "This is Internet Explorer. version" + $.browser.version);
}

// if only IE9 same as other like IE8, IE7
if(parseInt($.browser.version, 10) == 9) {
alert( "This is Internet Explorer 9. version" + $.browser.version);
}

Example: Alerts only for WebKit browsers
if ($.browser.webkit) {
alert( "This is webkit. version" + $.browser.version );
}

Example: Alerts only for Firefox browsers
if ( $.browser.mozilla) {
alert( "This is firefox. version" + $.browser.version  );
}

$.browser.version
"24.0.1312.57"
parseInt($.browser.version, 10)
24
Get browser info using jquery Get browser info using jquery Reviewed by Bhaumik Patel on 9:43 PM Rating: 5